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> <asp:regularexpressionvalidator id="vldtstimmlen" controltovalidate="txttstimmlen" display="dynamic" errormessage="immersion length" text="*" validationexpression="(0*[1-9]\d*)" runat="server"/> </td>
please help!
regularexpressionvalidator
s don't check empty values. need use requiredfieldvalidator
.
clarification per @karlanderson's comment: had placeholder text before edit caused regularexpressionvalidator
check value.
Comments
Post a Comment