js验证密码(实例代码)
<html> <head> <base href="<%=basepath%>"> <title>my jsp 'register.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> <!-- 验证两次密码输入是否一致 --> <script type="text/javascript" language="javascript"> function passwordissame(){ var password=document.userform.password.value; var repassword=document.userform.repassword.value; if(password!="" && repassword!=""){ if(password==repassword){ managerform.newpasswod.focus(); return true; } } window.alert("非法操作"); return false; } </script> </head> <body> <form name="userform" action="registerdeal.jsp" method="post" onsubmit="return passwordissame()"> 用户名:<input name="name" type="text"/><br/> 密 码:<input name="password" type="text"/><br/> 确认密码:<input name="repassword" type="text"/><br/> <input type="submit" value="register"> <input type="reset" value="reset"> </form> </body> </html>
如对本文有疑问, 点击进行留言回复!!
【JavaScript笔记(一)】万丈高楼平地起 - 基本概念篇
轻松解决 org.apache.taglibs.standard.tlv.JstlCoreTLV 困惑
vert实践五——Json?Protocol Buffer?FlatBuffers?
[基于tensorflow的人脸检测] 基于神经网络的人脸检测8——验证训练好的神经网络
网友评论