0

I'm using https://jqueryvalidation.org/ plugin for form validation. I need to enable/disable submit button depending on form validation result. How to do it?

1 Answer 1

1
  1. First you need to disable the button
  2. Listen to all Changes in the form

    $( "#myform :input" ).on('change', function(){
        var form = $( "#myform" );
        form.validate();
        if(form.valid())
            $('button).attr("disabled", false);
     });
    
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! It seems is what I need.

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.