<script type="text/javascript">
 function validate(){
     var name = document.forms[0].name.value;
     var password = document.forms[0].password.value;
     if(name==" " || password==" "){
           window.alert("名字和密码不能为空");
      }
 }
</script>

<html:form action="/login" >
    name : <html:text property="name" /> <html:errors property="name" />
    <br />
    password : <html:password property="password" /> <html:errors property="password" />
    <br />
    <br />
    <html:submit onclick="validate()" />
    <html:reset/>
</html:form>


久久不醉