function validate(){if (document.myform.username.value==""){alert("用户名不能为空bai.");
document.myform.username.focus();
return false ;}if (document.myform.userpass.value==""){alert("密码不能为空.");
document.myform.userpass.focus();
return false ;}
return true;}</script
jsp页面代码:du
<form action="conn.jsp" method="post" name="myform" return validate()“,即改成:zhi
这样就可以验证所提交表dao单元素的值是否为空了……

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-08-24
  • 2021-05-18
  • 2022-12-23
  • 2021-11-27
  • 2021-11-28
相关资源
相似解决方案