multiple validators on textfield w/display=dynamic don't display correctly

C

cp

I have a regularexpressionvalidator and a
requiredfieldvalidator attached to a textfield (that
takes an email address). I also have a first name and
last name field, each with a requiredfieldvalidator. I
set the display=dynamic for all the validators. The error
messages for the name fields work as I expect - i.e. the
error displays or not depending on whether the error
condition is met. The email field always displays an
error once one of the error conditions on it is met. I
expect it should not display once the error is fixed and
the textbox loses focus. The error message updates
correctly if I change, for example, an invalid email to
no entry.

Any suggestions on how to work around this or make the
messages display (or not) "correctly"?

Thanks,
cp
 
C

cp

Sure. I hope I'm not doing something stupid but
everything works properly when I remove one of the
validators on the email field. Thanks for any help.

<table cellpadding="0" cellspacing="14" border="0">
<tr>
<td class="adminBoxText" align="right"
nowrap><nobr>First name:</nobr></td>
<td class="adminBoxText"
align="left"><asp:textbox id=txtFirst
cssclass="adminBoxInput" runat="server" />
<asp:requiredfieldvalidator id=rfvFirst runat="server"
display="Dynamic" forecolor="#ff0000"
errormessage="Required"
controltovalidate="txtFirst" /></td>
</tr>
<tr>
<td class="adminBoxText" align="right"
nowrap><nobr>Last name:</nobr></td>
<td class="adminBoxText"
align="left"><asp:textbox id=txtLast
cssclass="adminBoxInput" runat="server" />
<asp:requiredfieldvalidator id=rfvLast runat="server"
display="Dynamic" forecolor="#ff0000"
errormessage="Required"
controltovalidate="txtLast" /></td>
</tr>
<tr>
<td class="adminBoxText" align="right"
nowrap><nobr>Email address:</nobr></td>
<td class="adminBoxText"
align="left"><asp:textbox id=txtEmail
cssclass="adminBoxInput" runat="server" />
<asp:requiredfieldvalidator id=rfvEmail runat="server"
display="Dynamic" forecolor="#ff0000"
errormessage="Required"
controltovalidate="txtEmail" /><asp:regularexpressionvalid
ator id=revEmail runat="server" display="Dynamic"
errormessage="Invalid email" controltovalidate="txtEmail"
validationexpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-
..]\w+)*" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td height="30"
valign="bottom"><asp:button id="btnSubmit" text="Submit"
runat="server" />&nbsp;&nbsp;<input type="button"
value="Cancel" onclick="history.back();"></td>
</tr>
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top