title: JQuery not validating struts2 form
body: <p>I am using struts2 framework for my application.
  I am also using jquery validation for validating form input at client side.
  however they both don't go with one another quite well.</p>
  
  <p>I have the UserBean Class which I want it to be there.</p>
  
  <p>I m using the following jquery &amp; struts form.. which <strong>does not validate the form</strong></p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
          $(document).ready(function(){
              var validator = $("#myform").validate({
                  rules: {
                      username: "required",
                      password: "required"
                  },
                  messages: {
                      username: "Please enter your username",
                      password: "Please enter your password"
                  }
              });
          });
      &lt;/script&gt;
  </code></pre>
  
  <hr>
  
  <pre><code> &lt;s:form method="POST" action="doLogin" name="myform" id="myform" cssClass="form" theme="simple"&gt;
              &lt;s:fielderror theme="simple" &gt;
  
                      &lt;label class="control-label" for="username"&gt;User Name &lt;/label&gt;
  
                          &lt;s:textfield name="userBean.userName" label="USER NAME"/&gt;
                          &lt;s:param&gt;userBean.userName&lt;/s:param&gt;
  
  
  
                      &lt;label class="control-label" for="username"&gt;Password  &lt;/label&gt;
  
  
                          &lt;s:password name="userBean.password" label="PASSWORD" /&gt;
                          &lt;s:param&gt;userBean.password&lt;/s:param&gt;
  
                  &lt;s:submit name="Submit" value="Submit"/&gt;
              &lt;/s:fielderror&gt;
          &lt;/s:form&gt;
  </code></pre>