单选(同意条框)提交表单
欢迎观看JackWMJ博客
你好! 这是你第一次看JackWMJ博客 。如果你想学习Java可以联系我。
//from表单
<!-- 同意条款 -->
<form id="Form" action="" method="post" name="addForm">
<input name="Terms" type="radio">本人承诺投保信息的真实性,并同意<a style="color:orange;" href="">《中华小当家》</a>的全部内容<br>
<input name="Terms" type="radio" checked="checked">
<!-- 底部 -->
<div style="width: 100%;height:70px;background-color: #E5E5E5;position: fixed;bottom: 0;">
<!-- 底部左边 -->
<div style="width: 50%;height: 100%;float: left;"></div>
<!-- 底部客服 -->
<div style="width: 17%;height: 100%;float: left;text-align: center;font-size: 20px;">
<div style="float: left;margin-top: 15px;"><img alt="" src="../img/insurance/客服.png"></div>
<div style="width: 85px;height: 26px;margin-left: 11px;margin-top: 26px;float: left">联系客服</div>
</div>
<!-- 底部总价 -->
<div style="width: 16%;height: 100%;float: left;text-align: center;font-size: 20px;">
<div style="width: 191px;height: 26px;margin-top: 29px;">总价:¥20.00</div>
</div>
<!-- 底部我要投保 -->
<div style="width: 17%;height: 100%;float: left;text-align: center;font-size: 20px;background-color: #F19149">
<div style="width: 100%;height: 26px;margin-top: 29px;text-align: center;" onclick="wantInsure()">我要投保</div>
</div>
</div>
</form>
//js代码
<script type="text/javascript">
function wantInsure () {
var radio = document.getElementsByName("Terms");
for (i=0; i<radio.length; i++) {
//获取同意radio框
if (radio[0].checked) {
alert("提交")
$("#Form").submit();
}else {
alert("什么也没选中!");
return false;
}
}
}
</script>