我在HTML表單上有3個輸入:舊密碼,新密碼和重新輸入新密碼。我爲新密碼字段使用JQuery密碼驗證插件。但是,如果三個輸入是密碼類型,則該插件會影響所有三個輸入。我希望它隻影響一個輸入(新密碼),我該怎麼做?下面是我的代碼:JQuery密碼驗證是否影響到所有輸入類型的密碼?
// The following code is in an UserControl, the form is in the page containt this control
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<script type="text/javascript">
// This script is for validation
Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(CheckValidationStatus);
function CheckValidationStatus(sender, args) { { var isValid = $("form").validate().form(); args.set_cancel(!isValid); } }
</script>
<table class="listing form" cellpadding="0" cellspacing="0">
<tr>
<td class="first"><strong>Old password:</strong></td>
<td class="last ofield">
<asp:TextBox ID="txtOldPassword" runat="server" CssClass="text required" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr class="bg">
<td class="first" width="172"><strong>New password:</strong></td>
<td class="last pwdfield">
<asp:TextBox ID="tNewPassword" runat="server" CssClass="text password" TextMode="Password" ></asp:TextBox>
<span>Password strength</span>
<div class="password-meter">
<div class="password-meter-message">Quá ng?n</div>
<div class="password-meter-bg">
<div class="password-meter-bar"></div>
</div>
</div>
</td>
</tr>
<tr>
<td class="first"><strong>Retype Password:</strong></td>
<td class="last ofield"><asp:TextBox ID="txtRetypePassword" runat="server" CssClass="text" TextMode="Password" ></asp:TextBox></td>
</tr>
</table>
<p style="text-align:right">
<asp:Button ID="Button1" runat="server" Text="Update" />
</p>
</ContentTemplate>
</asp:UpdatePanel>
請顯示您的代碼。 – JJJ 2012-02-22 11:38:13
你的代碼是什麼樣的?使用哪個jquery選擇器? – denolk 2012-02-22 11:38:32
請看我上面的代碼 – 2012-02-22 12:11:02