Submit Button gets disabled after submit when errors are still there

Support MB Frontend Submission Submit Button gets disabled after submit when errors are still there

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14466
    calpaqcalpaq
    Participant

    Dear Tran,
    I came across with the problem that was freezing the form when I submit the form. Detailed description about this is as follows.
    1) I have filled up the form clicked submit button
    2) Form has still errors so the cursor focused to first error field
    3) cleared errors in the form by filling up valid data & tried to submit but button was disabled & there is no road to go ahead.
    I figured out a solution to that is
    a) Found that script in this plugin is disabling submit button for saving from multiple submits.
    b) I have fixed this script using following modification of the script

    
    setTimeout( function() {
                    $this.children( '.rwmb-form-submit' ).children( 'button' ).prop( 'disabled', true );
                }, 0 ); 

    changed to

    
    setTimeout( function() {
                        if ($this.valid()) {
                            $this.children( '.rwmb-form-submit' ).children( 'button' ).prop( 'disabled', true );
                        }  else {
                            $this.children( '.rwmb-form-submit' ).children( 'button' ).prop( 'disabled', false);
                        }
     }, 0 ); 

    Please guide me that the path is correct?
    Regards,
    Calpaq

    #14470
    Anh TranAnh Tran
    Keymaster

    Hi Calpaq,

    Thanks a lot for your feedback. I've just realized the problem yesterday. Your solution seems right. I'll test it and release a new version.

    #14477
    Ryan LauritsenRyan Lauritsen
    Participant

    I can confirm we've had the same issue. Calpaq's fix seems to work. Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.