copyPasteGhost
asked on
Have validation start on same position on page ASP.NET 2.0
I want to have my validation stacked on top of eachother.
What happens here is that when no email is entered it displays the message fine.. but when the email is not valid is displays the message after the "RequiredFieldValidator" message. which looks stupid.
Does anyone know how to fix this?
Thanks,
What happens here is that when no email is entered it displays the message fine.. but when the email is not valid is displays the message after the "RequiredFieldValidator" message. which looks stupid.
Does anyone know how to fix this?
Thanks,
<table>
<tr>
<td style="text-align: right">
<asp:Label ID="lblEmail" runat="server" AssociatedControlID="txtEmail"></asp:Label><span style="color:Red">*</span>
</td>
<td>
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="reqValEmail" runat="server" ControlToValidate="txtEmail"
ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regValEmail" runat="server" ControlToValidate="txtPayPalAcc"
ErrorMessage="RegularExpressionValidator" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</td>
</tr>
</table>
ASKER
:) I do. the text is coming from the database. I changed it...
it's still doing the same thing...I included a picture of the problem.
Thanks
email-problem.GIF
it's still doing the same thing...I included a picture of the problem.
Thanks
email-problem.GIF
Set the "Display" property of the two validators to "Dynamic" to see if it will help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
So setting "Display=Dynamic" like I said in my post helped?
It's probably a good idea to choose a more user friendly error message such as "Please enter a valid email address." instead of "RegularExpressionValidato
Open in new window