另外注意:如果是<a target=_blank target="_blank" href="http://www.hrb.com:81/bootstrap/js/jquery-1.7.2.min.js" style="font-family: monospace;font-size:14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">bootstrap 在验证是不是必填项时,可以div里或td等里, 加 required/></td></a>
<form id="signupForm" class="regleader" action="<?=base_url() ?>member/resetpassword" method="post" name="signupForm" >
<tr>
<td width="180" height="40" align="right">输入新密码</td>
<td > <input type="password" style="width:180px" name="password" class="inputxt" value="" id="password" required/></td>
</tr>
<tr>
<td height="40" align="right">再次确认新密码</td>
<td><input type="password" value="" name="repassword" class="inputxt" id="repassword" required="" style="width:180px"/></td>
</tr>
<tr>
<td ></td>
<td ><button type="submit" class="btn btn-primary" id="login" style="width:200px" onclick="return insertManager()" > 下一步 </button>
</td>
</tr>
<tr>
<td height="10" colspan="2"></td>
</tr>
<tr><td height="10" colspan="3"></td></tr>
<tr><td colspan="3" align="center"><a href="<?=base_url() ?>bootstrap/intro.asp"> >>> 点击这里,反馈问题及提出建议和想法 >>></a></td></tr>
</table>
</form>
<div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function insertManager() {
var password = document.getElementById("password").value;
var repassword = document.getElementById("repassword").value;
if(password!=repassword){
window.alert("您输入的新密码与确认密码确认不一致");
signupForm.repassword.focus();
return false;
}
return true;
}
</script>
js验证 两次密码是否一致
本文转载:CSDN博客