How to validate a form using jquery?
<p>I have the  following code ..currently its validating but its not displaying error messages one by one i want to display all the error messages at once ...plz help me thanks in advance</p>

<pre><code>if ( $('#employeeid').length &gt; 0 ) {
            if ( $('#employeeid').val() || $('#employeeid').val() == '' ) {
                if( ! $('#employeeid').val().match(/^[I]{1}[BH]{1}[0-9]{1,4}$/i) ) {
                    $('#employeeid-element').append('&lt;ul class="errors"&gt;&lt;li&gt;&lt;ul class="errors"&gt;&lt;li&gt;Please enter a valid employee id&lt;/li&gt;&lt;/ul&gt;');
                      return false;
                  }
              }
          }



   if ( $("#firstname").val() || $("#firstname").val() == '') {
                if( ! $('#firstname').val().match(/^[a-z]{0,10}[\s]{0,2}[a-z]{0,10}$/i) ) {
                        $('#firstname-element').append('&lt;ul class="errors"&gt;&lt;li&gt;Please enter a employee first name: firstname&lt;/li&gt;&lt;/ul&gt;');
                        return false;
                    }

            } 
</code></pre>
