Adding a condition in jQuery submit() function -


I have a registration form for many people to register in my submit () jQuery function, I want to check that Does each email address match its related confirmation email address:

  jQuery ('[name =' email_address \\ [\\] "] ') .ech (function () {var Email = jQuery (this) .val (); var confirmation_email = jQuery (this) .parents ('section'). Next ('section'). Children ('input.confirm_email') .val (); if ( Email! = Confirmation_email) {Warning ("Confirm at least one email address Ti does not match email address. Please check all email addresses "); Return back;}});  

The problem is that, return false Disrupts the execution of my each function, not submit () function submit from within each function How to interrupt the function execution

Some variables each Declare outside and false These If emails are not equal, then return to the variable

  var emailCorrect = true; JQuery ('' [name = "email_address \\ [\\]"] '). Each (function () {var email = jQuery (this) .val (); var confirmation_email = jQuery (this) .parents ('. Section') .next ('section'). Children ('input.confirm_email') .val (); if (email! = Confirmation_email) {warnings ("At least one email address does not confirm mail confirmation email address. Please check all email addresses"); email narrow = false;}}); Return email is correct;  

Comments