我有以下登录表单,其中有两个 HTML5 文本框,需要验证:
<div id="SignUpForm" class="loginContainer">
<div style="width: 100%; height: 20px">
<div class="triangle">
</div>
</div>
<table class="loginForm" align="left">
<tr>
<td align="left" class="style1">
<input id="txtCustEmailID" type="email" name="txtCustEmailID" placeholder="Enter Email ID"
required style="width: 195px" />
</td>
<td align="left">
<asp:Button ID="btnCustLogin" runat="server" Text="Sign Up" OnClick="btnCustLogin_Click" />
</td>
</tr>
<tr>
<td align="left" class="style1">
<input id="txtCustPwd" name="txtCustPwd" type="password" required placeholder="Enter Password"
style="width: 193px" />
</td>
<td align="left">
<input id="btnCancel" type="button" value="Cancel" onclick="cancel('txtCustEmailID','txtCustPwd','SignUpForm')" />
</td>
</tr>
<tr>
<td colspan="2" align="left" style="font-size: medium; color: #FFFFFF;">
<a href="#RegOnSrchdialog" name="modal" style="color: #FFFFFF; font-weight: bold"
onclick="EnableRegFormTxt('txtCustEmailID','txtCustPwd','SignUpForm')">Register</a>
</td>
</tr>
</table>
</div>
在单击锚标记“注册”时,我正在调用一个 javascript 函数EnableRegFormTxt,我使用它来禁用登录表单文本框,以便它们的验证也将被禁用,但是这个 js 不起作用,我无法做任何回发由于验证,在页面上。
js是:
function EnableRegFormTxt(i, j, k) {
document.getElementById("txtCustFName").disabled = false;
document.getElementById("txtCustLName").disabled = false;
document.getElementById("txtCustREmail").disabled = false;
document.getElementById("txtCustRPwd").disabled = false;
document.getElementById("txtCustRePwd").disabled = false;
document.getElementById("txtCustPh").disabled = false;
document.getElementById(i).disabled = true;
document.getElementById(j).disabled = true;
document.getElementById(k).style = "display:none";
}
请让我知道我错在哪里。谢谢。