A
Arpan
A Web control like a textbox can be validated using Regular Expressions like the following:
<form runat=server>
Name: <asp:TextBox id="txtName" runat=server/>
<asp:RequiredFieldValidator ControlToValidate="txtName" ErrorMessage="Please enter your name!" Display="Dynamic" runat=server/>
............
.............
</form>
In the above code, users will be alerted immediately if they don't enter their name. ASP.NET will not allow the Form to be posted if the Name textbox is empty & hence no info will be sent back & forth from the server to validate the textbox.
Now the same Form can be created using the textbox HTML Server control like the following:
<form runat=server>
<input type=text name="txtName" id="txtName" runat=server>
............
.............
</form>
Can the 2nd Form be validated using Regular Expressions in the same way as what has been done in the 1st Form? If no then how to validate the 2nd Form so that users are alerted immediately if they leave the textbox empty?
Thanks,
Arpan
<form runat=server>
Name: <asp:TextBox id="txtName" runat=server/>
<asp:RequiredFieldValidator ControlToValidate="txtName" ErrorMessage="Please enter your name!" Display="Dynamic" runat=server/>
............
.............
</form>
In the above code, users will be alerted immediately if they don't enter their name. ASP.NET will not allow the Form to be posted if the Name textbox is empty & hence no info will be sent back & forth from the server to validate the textbox.
Now the same Form can be created using the textbox HTML Server control like the following:
<form runat=server>
<input type=text name="txtName" id="txtName" runat=server>
............
.............
</form>
Can the 2nd Form be validated using Regular Expressions in the same way as what has been done in the 1st Form? If no then how to validate the 2nd Form so that users are alerted immediately if they leave the textbox empty?
Thanks,
Arpan