setcustomvalidity如何使用 详细实例
要求对密码进行二次输入验证,即第二次输入密码必须与第一次输入内容相同才可以提交,否则提示“”您两次输入密码不一致,请重新输入!“”
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>setcustomvalidity</title>
<script language="javascript">
</script>
</head>
<body>
<form action="" method="get">
<ul>
<li><label>用户名</label></li>
<input type="text" name="username" required="required" />
<li><label>密码</label></li>
<input type="password" name="password" required="required" placeholder="请输入密码"/>
<li><label>请再次输入密码</label></li>
<input type="password" name="password1" required="required" placeholder="请再次输入密码"/><br />
<input type="submit" name="submit"/>
</ul>
</form>
</body>
</html>