Question

$(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

Was it helpful?

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"

OTHER TIPS

If a function is assigned to onValidationComplete then this is executed instead of the form being submitted, so your description is exactly what jQuery-Validation-Engine is designed to do.

Until jQuery-Validation-Engine version 2.6.4 this was the only behavior, from this version on you can return true in onValidationComplete to tell the validation engine to continue submitting the form. The default behavior if the function has no return value is still to stop the submit.

See https://github.com/posabsolute/jQuery-Validation-Engine/pull/442 for the change to handle return values.

try this...

<script>
  jQuery(document).ready( function() {
    jQuery("#formID").validationEngine('attach',{
     onValidationComplete: function(form, status){
      if (status == true){
       YourFunctionReload();
       // here :)
       return true;
      }}});
    });
</script>

Please try this, hope it will work for you..

$('#formID').validationEngine('attach',{
    onValidationComplete: function(form, status){

        if (status == true){
            $("#formID").submit();
            return true;
        }

    }
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top