how to validate all inputs by class name using jquery don't want to use any plugin like validate
<p>i want to validate all inputs using class name i'm using following code</p>

<pre><code>$('#submitbutton').click(function() {

           $('input.inputme[type=hidden]').each(function () {

                 if($(this).val()==''){
                     choclates='false';
                 }else{
                      choclates='true';
                     }                      
            });
         if(choclates=='true'){
                  $('#choclateform').submit();
                 }else{
                 alert("Please Fill all Boxes.");
                 }

        });
</code></pre>

<p>when i posted this question code was different and was not working full but this works but i think i'm making it complicated can someone make it better ?</p>
