<script language="javascript">
function validate(myform){
if(myform.name.value.length==0){
alert("请输入用户名!");
myform.name.focus();
return false;
}
if(myform.email.value.length==0){
alert("留下你的邮箱!");
myform.email.focus();
return false;
}
if(myform.content.value.length==0){
alert("说点什么吧!");
myform.content.focus();
return false;
}
return true;
}
</script>
这段简单的验证代码在本地运行无误,但放到tomcat下就失效了,没有弹出框提示,这是为什么?