こんにちは私はそれがjquery.With私はsubmit1をクリックすると、table2だけを検証する必要がありますsubmit2をクリックすると、それはtable1を検証する必要があります。asp.netでjqueryのグループ化の概念
今、それは私がCSS classes as flags is a great way to emulate
を使用して、個々のテーブルの検証
<html>
<head>
<script type="text/javascript">
$(document).ready(function() {
$("#form1").validate({
rules: {
<%= txtUserName.UniqueID %>: {minlength: 5, required: true},
<%= txtPassword.UniqueID %>: {minlength: 5, required: true},
<%= txtURL.UniqueID %>: {required: true},
},
messages: {
<%= txtUserName.UniqueID %>: {
required: "Plaese enter your name",
minlength: "User name must be atleaet of 5 characters"
},
<%= txtPassword.UniqueID %>: {
required: "Plaese enter your password",
minlength: "Password must be atleaet of 5 characters"
},
<%= txtURL.UniqueID %>:{ required: "Plaese enter Website URL",},
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<table width="50%" cellpadding="2" cellspacing="4" style="border: solid 1px navy; background-color: #d5d5d5;">
---username--
--password--
--url----
submit1
</table>
<table width="50%" cellpadding="2" cellspacing="4" style="border: solid 1px navy; background-color: #d5d5d5;">
---Firstname--
--Lastname--
-Address----
submit2
</table>
</form>
</body>