Multiple Validators printing multiple messages

T

tshad

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
 
T

tshad

Peter Blum said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top