asp.net - RegularExpressionValidator is not working -


i'm total newbie in using asp.net , have regular expression validator working fine before after made huge edit textboxes not working anymore.

in before edit, when try submit form, if textbox empty or value = "" show error message , not redirect page.

in after edit, when try submit form, whether textbox empty or not redirect page. not stopping page redirecting or showing validator

before edit.

<asp:textbox id="txttstimmlen" cssclass="forimmlentb" runat="server" width="118" text="enter value here" onclick="this.value=''" onblur="tryplaceholder(this,'enter value here')" ></asp:textbox> <asp:regularexpressionvalidator id="vldtstimmlen" controltovalidate="txttstimmlen" display="dynamic" errormessage="immersion length" text="*" validationexpression="(0*[1-9]\d*)" runat="server"/> 

after edit

<asp:textbox id="txttstimmlen" cssclass="forimmlentb" runat="server" width="118" onblur="tryplaceholder(this);"></asp:textbox>&nbsp; <asp:regularexpressionvalidator id="vldtstimmlen" controltovalidate="txttstimmlen" display="dynamic" errormessage="immersion length" text="*" validationexpression="(0*[1-9]\d*)" runat="server"/>&nbsp;</td> 

please help!

regularexpressionvalidators don't check empty values. need use requiredfieldvalidator.

clarification per @karlanderson's comment: had placeholder text before edit caused regularexpressionvalidator check value.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -