Search code examples
jqueryjquery-validation-engine

validationEngine not submitting form using onValidationComplete


$(document).ready(function(){
    jQuery("#bbSignup").validationEngine('attach', {
  onValidationComplete: function(form, status){
      if ( status == "true" ) {
$("#bbSignup").submit();
    $("#bbSignup").hide();
    $("#bbRegister").insertAfter("Form Submitted");
      } else {

      }
  }  
});
   });

Nothing happens if I fill out all of the forms and hit submit. Even pressing it multiple times does nothing. Any ideas?

---EDIT---

I changed it to this:

jQuery("#bbSignup").validationEngine('attach', {
onValidationComplete: function(form, status){
if ( status == "true" ) {
alert(" The status is " + status + " and will submit ");
} else {
alert(" The status is " + status + " and will not submit ");
}
}  
});

If nothing is filled out the else alert fires correctly. if Everything is filled out the alert says "The status is true and will not submit". So it's like the if status == true is never being called.. weird


Solution

  • This is just a guess, but you're interrogating status as though it holds a string. Since you're testing for the strings "true" and "false", though, it seems more likely it holds a boolean.

    Try simply

    if (status) { //test it against the boolean true, not string "true"