如何在ASP.net中验证文本框?

问题描述:

在客户端使用Java脚本验证文本框时,我需要帮助.请帮助我..

I need help on validating a text box using java script at client side. Plz help me..

尝试在 ^ ].

只需在此处进行简单搜索就可以确保快速解决您的问题.

该搜索显示4,490,000个结果,并且其中许多搜索结果线程肯定可以解决您的问题.

尝试以下线程:验证文本框 [如何问一个好问题? [ ^ ]
Try search on google[^].

A simple search here can solve your problem in quick time for sure.

This search shows 4,490,000 results, and many of those search result threads will surely solve your problem.

Try this thread: Validate TextBox[^]

and don''t ask question like validating text box.
Be specific!
Specify exactly what it is you need help with.

Refer: How to ask a good question?[^]


如果您正在开发ASP.net网站,请尝试此链接
http://forums.asp.net/t/1356162.aspx/1 [ ^ ]
Try this link if you are developing an ASP.net website
http://forums.asp.net/t/1356162.aspx/1[^]


<form id="form1" runat="server">
    Your name:<br />
    <asp:TextBox runat="server" id="txtName" />
    <asp:RequiredFieldValidator runat="server" id="reqName" controltovalidate="txtName" errormessage="Please enter your name!" />
    <br /><br />
    <asp:Button runat="server" id="btnSubmitForm" text="Ok" />
</form>




使用必需的字段验证器和有效的表达式验证器

http://asp.net-tutorials.com/validation/required-field-validator/ [ ^ ]


http://asp.net-tutorials.com/validation/regular-expression-validator/ [ ^ ]




use required field validator and regualar expression validatior

http://asp.net-tutorials.com/validation/required-field-validator/[^]


http://asp.net-tutorials.com/validation/regular-expression-validator/[^]