JavaScript 表单提交上的JS Check agreement复选框

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript 表单提交上的JS Check agreement复选框相关的知识,希望对你有一定的参考价值。

<script type="text/javascript">
function check_agreement() {
//if the agreement checkbox is checked, return true, otherwise return false
if(document.getElementById('LocationAgree').checked == true) {
return true;
} else { 
alert('Please agree to the terms and conditions.');
return false;
}
}
</script>

以上是关于JavaScript 表单提交上的JS Check agreement复选框的主要内容,如果未能解决你的问题,请参考以下文章