Jquery validating a form and then performing a function
I have the following problem. I wish to validate the form by clicking on the button and if the form is valid make the overlay pop up.
$(document).ready(function() {
$('#submitButton').click( function(){
if ($("#EnquiryFormContact").chec开发者_StackOverflow社区kValidity() == true) {
//If true call here
//alert("Form is good");
$("a[rel]").overlay({
mask: '#000'
})
}
else
{
//if false call here
alert("Form is bad");
}
//Return False to disable the submit but allow the button to be triggered.
return false;
});
});
My code is not that great and I am just learning but any help would be appreciated.
Check the jQuery UI section of this post: http://www.jensbits.com/2009/08/10/modal-confirmation-dialog-on-form-submit-javascript-jquery-ui-and-thickbox-varieties/
It may point you in the right direction.
精彩评论