如何使用JQuery进行客户端验证?

问题描述:

如何使用JQuery在客户端进行验证?

How to do validation on client-side using JQuery?

Thanks in advance!

请使用jQuery的验证插件来做到这一点: ^ ].
这就是进行客户端验证的方法.

希望对您有帮助.

干杯!
Please use the Validation plugin for jQuery to do that: http://docs.jquery.com/Plugins/validation[^].
That''s the way to do clientside validation.

Hope that helps you.

Cheers!


如果您是初学者,请参考此站点:

http://www.dotnetcurry.com/ShowArticle.aspx?ID=231 [ ^ ]

从那里添加示例:

示例1 –使用jQuery在asp:Button单击上显示警报
将Button元素添加到页面,如下所示:
As you are a beginner,please refer this site:

http://www.dotnetcurry.com/ShowArticle.aspx?ID=231[^]

Adding an example from there:

Example 1 – Display an alert on asp:Button click using jQuery
Add a Button element to the page as shown below:
<asp:button id="Button1" runat="server" text="Button" xmlns:asp="#unknown" />

现在为了告诉浏览器在准备好或加载文档后立即使用jQuery执行某些操作,请使用以下代码块:

Now in order to tell the browser to perform some action using jQuery as soon as the document is ready or loaded, use this block:

<script type="text/javascript">


(document).ready(function() { // add code here }); </script>
(document).ready(function() { // add code here }); </script>

在功能块中添加代码

Add your code in the function block

<script type="text/javascript">