form表单 JS设置return false还是会提交。请帮忙查看。谢谢各位 5
代码如下:<script>functionchkform(form){if(form.info.value==""){alert('请选择谁好?');form.info....
代码如下:
<script>
function chkform(form){
if (form.info.value=="") {
alert('请选择谁好?');
form.info.select();
return false;
}
}
</script>
<form action="test2.php" method="get" name="testform" onsubmit="return chkform(this)">
<input type="radio" name="info" value="1">你好
<input type="radio" name="info" value="2">我好
<input type="radio" name="info" value="all">大家好
<input type="submit" value="提交">
</form> 展开
<script>
function chkform(form){
if (form.info.value=="") {
alert('请选择谁好?');
form.info.select();
return false;
}
}
</script>
<form action="test2.php" method="get" name="testform" onsubmit="return chkform(this)">
<input type="radio" name="info" value="1">你好
<input type="radio" name="info" value="2">我好
<input type="radio" name="info" value="all">大家好
<input type="submit" value="提交">
</form> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询