0

I was doing this. and i was doing pretty ok with the tutorial i am doing the validation for form like this

<script>
  jQuery(document).ready(function() {
    jQuery("#formID2").validationEngine('attach', {
      onValidationComplete: function(form, status) {
        alert("The form status is: " + status + ", it will never submit");
      }
    })
  });
</script>

I am wondering how to make the validation using button click.. I want to remove the submit form and i want to put the validation on button click. Any suggestion is appreciated

2 Answers 2

0
$("#Button1").click(function () {
            var valid = $("#form1").validationEngine('validate');
            var vars = $("#form1").serialize();

            if (valid == true) {

                alert("Hi");

            } else {
                $("#form1").validationEngine();
            }
        });

Try this one i got it from here it worked for me!

Sign up to request clarification or add additional context in comments.

Comments

0

When Button type is == Submit then use follwing code,

$("#FormId").validationEngine({
        onValidationComplete : function(form, status) {
            if (status) {
                 alert("Hi");                   
            }
            return false;
        },
        scroll : false,
    });

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.