In the form verification, if the form information is more, resulting in the Submit button and error message is not displayed on the screen, it will be unable to submit, and no friendly prompt question.
The ideal solution is to automatically locate the error prompt when the error is verified, so that the user can view and modify it.
$ ("#Send"). Click (function (e) { //This line is opera's patch, less it opera is directly with the jump and the picture flashes $body = (window.opera)? (Document.compatmode = = "Css1compat"? $ (' HTML '): $ (' body ')): $ (' html,body '); Form submission error locating to a specific error location facilitates user modification if (!$ (' form). Valid ()) { var targetid = ""; $ ($ (' form). Validate (). errorlist). Each (function (index, item) { if (Targetid = = "") { Targetid = $ (item). attr ( ' element '). attr (' id ');} }); $body. Animate ({scrolltop: $ (' # ' + targetid). Offset (). top-30}, +); return; } );
Jump to the first location of the error
jquery Form Validation Validate