男主角叫李木的小说:一个简单角本问题

来源:百度文库 编辑:高考问答 时间:2024/04/30 05:59:02
if(document.form1.student.value=="")
{
alert("请填写")
document.form1.student.focus();
return false;
}

在这段代码中,其他的都懂,可是就是那个 return false;是什么意思
哪位高手给说说。。

提醒:漏了一个“;”

return false 就是返回一个“false”值,默认是“true”
在提交时:
<form name="form1" action="" onsubmit="return check()">
……
</form>
以上就是当提交时,触发检查,当form1.student.value==""时返回“false”值,那么表单也就不会被提交出去!