如何在asp.net表单中使用Jquery在母版页和内容页中实现验证 [英] How to implement validations in master page and content pages using Jquery in asp.net forms

查看:54
本文介绍了如何在asp.net表单中使用Jquery在母版页和内容页中实现验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



如何使用jquery编写验证脚本,我有大表格。这种形式有20张桌子。所有表格显示:无。每个表有15-20个字段,每个表中前5个字段是必需的。和提交一个按钮



我的问题是如何显示必填字段错误只显示块表。



如何编写jquery脚本..?



每张桌子都有链接按钮。在此按钮代码后面设置表格显示属性,如style.Add(display,none)或style.Add(display,block);



当点击套装按钮然后显示验证消息。?



所以,如何编写脚本。?

please帮助我。



谢谢和问候

Hi all,

how to write the script for validations using jquery, i have large form. in this form having 20 tables. All tables display:none. each table having 15-20 fields and in every table first 5 fields are required. and one button like submit

my question is how to show the required fields errors only display block tables.

how to write the jquery script..?

Every table table having the link button. in this button code behind set the table display property like style.Add("display","none") or style.Add("display","block");

when ever click on suit button then shows the validation messages.?

so, how to write the script.?
please help me.

thanks and regards

推荐答案

请参考这个......



包含名称的注册表单的JQuery验证,电子邮件,手机号码,密码 [ ^ ]



在上面的例子中,我用一种形式编写了验证。你只需要做的就是





Please refer this...

JQuery Validation for Registration form containing name, email, mobile number, password[^]

In the above example I written validation with in one form. You just have to do is



.table_validate)。each( function ()
{
if
(".table_validate").each(function() { if(


)。attr( display)=== block
{
// 这里写的验证如上所述提示......
}
});
(this).attr("display")==="block") { // here write validation as written in above Tip... } });





在上面的代码中, table_validate 所有表的公共类名。并检查表样式是否显示阻止。如果表格样式为,则进行验证...



希望这对您有所帮助......



In the above code "table_validate" is common class name for all tables. And checking whether the table style is display block or none. If the table style is block then do validation...

Hope this will help you...

这篇关于如何在asp.net表单中使用Jquery在母版页和内容页中实现验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆