在写了一个jsp页面后,加入JavaScript代码<script type="text/javascript" language="java">
function check(){
var tname=document.form1.titlename.value;
var fpath=document.form1.filepath.value;

if(tname.length==""){
alert("二级标题不能为空!");
tname.focus();     加入这行以下都跳出
return false;
}

if(fpath.length==""){
alert("文件地址不能为空!");
return false;
}
return true;
}
</script>
加入了tname.focus()后竟然跳过后面所有代码直接到return true这行,大家碰到过这种事吗?