jquery Plugins/Validation using submitHandler
<p>Greeting,</p>

<p>I'm using jquery Plugins/Validation library. I want to allow validation on submitting  but I'm not sure where I should insert the code:
I know that I can user  submitHandler for that but after reading the document I had hard time to implement it so I need your help guys.</p>

<p>jquery validation is working ok but the problem that the form still submitted even there are invalid inputs.</p>

<p>here is my validation function and I want to know how can I make it to not submit the form if there is invalid input.</p>

<p>by the way, I'm using asp.net button for submitting the form.</p>

<p>here is my code: </p>

<pre><code>  $(document).ready(function() {


             $("#aspnetForm").validate({




                 rules: {
                     "&lt;%=txtHomePhone.UniqueID %&gt;": {

                         phonehome: true
                     },

                     "&lt;%=txtMobileHome.UniqueID %&gt;": {

                         mobilephone: true


                 },

                   "&lt;%=txtFaxHome.UniqueID %&gt;": {

                   faxhome: true

               },

               "&lt;%=txtEmailHome.UniqueID %&gt;": {

                   email: true

               },


               "&lt;%=txtZipCodeHome.UniqueID %&gt;": {

               ziphome: true

               },

               //work
                           "&lt;%=txtPhonework.UniqueID %&gt;": {

                         phonework: true
                     },

                     "&lt;%=txtMobileWork.UniqueID %&gt;": {

                         mobilework: true


                 },

                   "&lt;%=txtFaxWork.UniqueID %&gt;": {

                   faxwork: true

                     },
                     "&lt;%=txtEmailWork.UniqueID %&gt;": {

                   email: true

               },

               "&lt;%=txtWebSite.UniqueID %&gt;": {

                   url: true

               },
               "&lt;%=txtZipWork.UniqueID %&gt;": {

               zipwork: true

               }



                 },




                   errorElement: "mydiv",
                    wrapper: "mydiv",  // a wrapper around the error message

                      errorPlacement: function(error, element) {
                      offset = element.offset();
                      error.insertBefore(element)
                      error.addClass('message');  // add a class to the wrapper
                      error.css('position', 'absolute');
                      error.css('left', offset.left + element.outerWidth());
                      error.css('top', offset.top - (element.height() / 2));

                  }



            });
</code></pre>
