473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Single Validator for 3 field Phone Number

I'm using C#.net.

I have a phone number in three asp textboxes. I'd like to make the phone number required, and validate to make sure only numbers have been entered.

My main problem is I can't find a way to have all three textboxes use the same validator and not display 3 error messages.

--------------------------------
From: Sharon Traineanu

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>eZGYaPTSrUuCnHzI4El7Lg==</Id>
Nov 18 '05 #1
2 2210
This is just not possible with the standard validation controls.
You'll have to create your own solution.
For this, you might find these links useful:
http://msdn.microsoft.com/library/de...mmatically.asp

http://msdn.microsoft.com/library/de...ionresults.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Sharon Traineanu via .NET 247" <an*******@dotnet247.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm using C#.net.

I have a phone number in three asp textboxes. I'd like to make the phone number required, and validate to make sure only numbers have been entered.
My main problem is I can't find a way to have all three textboxes use the same validator and not display 3 error messages.
--------------------------------
From: Sharon Traineanu

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>eZGYaPTSrUuCnHzI4El7Lg==</Id>

Nov 18 '05 #2
Hi Sharon,

Instead of writing custom code, there is a commercial solution that lets you
do this without coding. "Professional Validation And More"
http://www.peterblum.com/vam/home.aspx has 22 validators. Its
MultiConditionValidator lets you combine the power of validators into a
single validator. For example, you would be able to combine Required
validators and DataTypeCheck validators like this:
TextBox1 is Required AND TextBox1 must be an integer AND TextBox1 must have
3 characters AND
TextBox2 is Required AND TextBox2 must be an integer AND TextBox2 must have
3 characters AND
TextBox3 is Required AND TextBox3 must be an integer AND TextBox3 must have
4 characters

The result generates client-side code that is supported by IE,
Netscape/mozilla, Opera 7, and Safari (Microsoft's validators are limited to
DHTML browsers).

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Sharon Traineanu via .NET 247" <an*******@dotnet247.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm using C#.net.

I have a phone number in three asp textboxes. I'd like to make the phone number required, and validate to make sure only numbers have been entered.
My main problem is I can't find a way to have all three textboxes use the same validator and not display 3 error messages.
--------------------------------
From: Sharon Traineanu

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>eZGYaPTSrUuCnHzI4El7Lg==</Id>

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael ALbanese | last post by:
I am developing a telephone directory for my company. I have Fist Name, Last Name, Department and Phone Number as fields. A user can search by entering data into any one, or combination of these...
6
by: simina | last post by:
Hi... I have a form with 4 number fields: phone area, phone number, cell area, cell number. I did a function that checks the "number" issue for all 4 fields in the same time (because the code is...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
0
by: Bryce Budd | last post by:
Hello All, I've been a taker of information from newsgroups for a long time and thought I'd finally make a contribution back to the community whose supported me when I've needed it. After all...
2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
0
by: Thomas Scheiderich | last post by:
I have a screen that just takes a phone book entry. In the Cell Phone question, it checks to see if the field has changed. If the field is no, it disables the textbox and greys out the label. If...
3
by: Mad Scientist Jr | last post by:
i am trying to validate a field for a double, but not allow commas the regex specifies any number of whole number digits * no comma * an optional...
10
by: AA Arens | last post by:
I have two tables, one consists of company info like name and phone number. Another table where I have to fill in the contact persons. Part of the form is to choose the company he works for (From...
0
by: mayankagarwal | last post by:
Over the last few days i have read a lot of forum about custom validator not working or not firing etc. I am stuck in a similar situation and of all the solutions i have come across they dont seem to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.