开发者

Jquery validating a form and then performing a function

开发者 https://www.devze.com 2023-03-05 01:37 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号