473,508 Members | 2,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Validators printing multiple messages

Sorry,

My last post got messed up.

I have a password box that I want to validate for required as well as for
validity. So I have the following:

***********************************************
<td align="right">Password</td>
<td><asp:textbox id="txtPassword" TextMode="Password" Columns="32"
runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="You must enter an password"
Font-Size="10"
runat="server" />
<asp:CustomValidator
ControlToValidate="txtEmail"
OnServerValidate="ValidateEmail"
Font-Size="10"
Display="Dynamic"
Text="Not Valid !"
runat="server" />
</td>
************************************************** *************

If I put nothing in the field, I get:

You must enter an password Not Valid !

Why is this? I want both validators as I need to make sure something is
entered and get one message and if something is entered, I need a different
message if the password is invalid.

Thanks,

Tom
Nov 19 '05 #1
2 921
Your validators point to different controls with their ControlToValidate
properties.
--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"tshad" <ts**********@ftsolutions.com> wrote in message
news:uV**************@TK2MSFTNGP15.phx.gbl...
Sorry,

My last post got messed up.

I have a password box that I want to validate for required as well as for
validity. So I have the following:

***********************************************
<td align="right">Password</td>
<td><asp:textbox id="txtPassword" TextMode="Password" Columns="32"
runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="You must enter an password"
Font-Size="10"
runat="server" />
<asp:CustomValidator
ControlToValidate="txtEmail"
OnServerValidate="ValidateEmail"
Font-Size="10"
Display="Dynamic"
Text="Not Valid !"
runat="server" />
</td>
************************************************** *************

If I put nothing in the field, I get:

You must enter an password Not Valid !

Why is this? I want both validators as I need to make sure something is
entered and get one message and if something is entered, I need a
different message if the password is invalid.

Thanks,

Tom

Nov 19 '05 #2

"Peter Blum" <PL****@Blum.info> wrote in message
news:up**************@TK2MSFTNGP15.phx.gbl...
Your validators point to different controls with their ControlToValidate
properties.
You're right.

I must be blind. When I changed it, it worked fine.

Thanks,

Tom

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

"tshad" <ts**********@ftsolutions.com> wrote in message
news:uV**************@TK2MSFTNGP15.phx.gbl...
Sorry,

My last post got messed up.

I have a password box that I want to validate for required as well as for
validity. So I have the following:

***********************************************
<td align="right">Password</td>
<td><asp:textbox id="txtPassword" TextMode="Password"
Columns="32" runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="You must enter an password"
Font-Size="10"
runat="server" />
<asp:CustomValidator
ControlToValidate="txtEmail"
OnServerValidate="ValidateEmail"
Font-Size="10"
Display="Dynamic"
Text="Not Valid !"
runat="server" />
</td>
************************************************** *************

If I put nothing in the field, I get:

You must enter an password Not Valid !

Why is this? I want both validators as I need to make sure something is
entered and get one message and if something is entered, I need a
different message if the password is invalid.

Thanks,

Tom


Nov 19 '05 #3

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

Similar topics

8
579
by: TJS | last post by:
what are folks doing to get around limitation of one server form per page ?
1
3906
by: Ken Varn | last post by:
If a page has multiple ValidationSummary controls, how does it distinguish which ValidationControls are associated with which ValidationSummary controls? The reason I am asking this is that I...
1
2107
by: epigram | last post by:
I'm trying to use the ASP.NET validators to check some client-side business rules. I've got two ASP TextBox controls (call them tbxYear1 and tbxYear2) used to enter a range of years. I've got a...
4
1447
by: msnews.microsoft.com | last post by:
I have 2 datagrids. Each with an add record in the footer. How can I just validate the fields in that datagrid without validating the fields in the 2nd datagrid. Any examples??? -- David
1
5682
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
4
2580
by: Brybot | last post by:
I have a form that i've split up into multiple asp:panels, each panel has a number of validators which work correctly. At on the last panel, i want to commit the data collected to a database. I...
4
1259
by: Madhur | last post by:
Hello All I am learning how to use ASP.NET Validators and would appreciate if someone could provide me with guidance. I have written very simple ASPX page below with a Dropdown list, a...
2
1110
by: Jordan S. | last post by:
I'm experimenting with dynamically inserting custom composite Web server controls onto a page. For testing purposes I have two custom composite Web server controls that each have a couple of...
2
4505
by: timj | last post by:
Anyone suggestions how to cleanly realize a page with multiple validationsummaries that display only the messages of controls that belong to the same validationgroup? So for example three...
0
7223
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
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
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...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.