<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
function check(){
if(!document.getElementById("aaa").checked){
alert("你必须同意协议");
return false}
return true
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div style="border:1px solid #ace;width:800px;height:400px;margin:5px auto;padding:5px">用户协议</div>
<div style="width:800px;margin:5px auto;text-align:right">
<p>
<label>
<input type="checkbox" name="aaa" id="aaa" />
我同意</label>
</p>
<p>
<input type="submit" name="button" id="button" value="注册" onclick="return check()" />
</p>
</div>
</form>
</body>
</html>
HTML注册时验证是否勾选协议
猜你喜欢
转载自blog.csdn.net/qq_41255880/article/details/102570566
今日推荐
周排行