Home › Forums › JavaScript › jQuery Validation › Re: jQuery Validation
February 7, 2013 at 4:03 pm
#123724
Participant
If you are testing if a value is empty, null, etc you can simply modify that script, however, i suggest using the jQuery Validation plugin. Also, i once included this within a page (static page) along with the plugin but i dont believe you need it.
$(function() {
$('form').submit(function() {
if(typeof jQuery.data(this, "disabledOnSubmit") == 'undefined') {
jQuery.data(this, "disabledOnSubmit", { submited: true });
$('input[type=submit], input[type=button]', this).each(function() {
$(this).attr("disabled", "disabled");
});
return true;
} else {
return false;
}
});
});
jQuery Validation Plugin Demo: http://jquery.bassistance.de/validate/demo/