Custom Fields
Re-Envisioned
Support MB Frontend Submission Submit Button gets disabled after submit when errors are still there

This topic contains 2 replies, has 3 voices, and was last updated by  Ryan Lauritsen 2 months, 2 weeks ago.

  • Creator
    Topic
  • #14466

    calpaq
    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #14470

    Anh 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 Lauritsen
    Participant

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

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.