Validators putting space in front of message

T

tshad

I have the following textbox and 3 validators. For some reason the message
"A Password is required!" is displayed with a couple of spaces in front of
it. My other validators don't seem to do this. They are all set to
Dynamic.

<asp:textbox id="Password" TextMode="Password" Columns="25"
runat="server" />
<asp:RegularExpressionValidator
ControlToValidate="Password"
Display="Dynamic"
Text="Your password must contain between 6 and 20 characters!"
ValidationExpression="\w{6,20}"
Runat="Server" />
<asp:RegularExpressionValidator
ControlToValidate="Password"
Display="Dynamic"
Text="Your password must contain at least one number and letter!"
ValidationExpression="([a-zA-Z]+\w*\d+\w*)|([0-9]+\w*\d*)"
Runat="Server" />
<asp:RequiredFieldValidator
ControlToValidate="Password"
Display="Dynamic"
Text="A Password is required!"
runat="server" />


The View source shows:
******************************************************************
<input name="_ctl0:password" type="password" size="25" id="_ctl0_Password"
/>
<span id="_ctl0__ctl3" controltovalidate="_ctl0_Password" display="Dynamic"
evaluationfunction="RegularExpressionValidatorEvaluateIsValid"
validationexpression="\w{6,20}" style="color:Red;display:none;">Your
password must contain between 6 and 20 characters!</span>
<span id="_ctl0__ctl4" controltovalidate="_ctl0_Password" display="Dynamic"
evaluationfunction="RegularExpressionValidatorEvaluateIsValid"
validationexpression="([a-zA-Z]+\w*\d+\w*)|([0-9]+\w*\d*)"
style="color:Red;display:none;">Your password must contain at least one
number and letter!</span>
<span id="_ctl0__ctl5" controltovalidate="_ctl0_Password" display="Dynamic"
isvalid="False" evaluationfunction="RequiredFieldValidatorEvaluateIsValid"
initialvalue="" style="color:Red;">A Password is required!</span>
******************************************************************

What is causing the extra spaces and why is the other validators even
showing up, if they are not displaying.

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top