Some issues – Multi step form + save & continue

Home Forums Jquery Validation For Gravity Forms Some issues – Multi step form + save & continue

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #451565
    Kevin
    Guest

    Hey guys,

    I have some issues with multi step forms and the save & continue later feature.

    On multi step forms I cannot go back, if not all required fields on the current page are filled.

    You cannot save & continue later, if not all required fields on the current page are filled.

    Is it possible to disable the validation on the back-button and the save&continue-button?

    Thank u!

    #451975
    Kevin Knollmeier
    Participant

    Hey guys,

    found a solution on myself that works for me. Perhaps it is helpful for others.

    First of all I disable the next and submit button within the jvgf_initialize function:

    var form = this;

    if (jQuery(form).validate({onsubmit: false}).checkForm()) {
    jQuery(‘.gform_next_button’).prop(‘disabled’, false);
    jQuery(‘.gform_button’).prop(‘disabled’, false);
    } else {
    jQuery(‘.gform_next_button’).prop(‘disabled’, ‘disabled’);
    jQuery(‘.gform_button’).prop(‘disabled’, ‘disabled’);
    }

    Then I validate the form on blur, keyup, click and change:

    jQuery(‘input’).on(‘blur keyup click change’, function() {
    if (jQuery(form).validate({onsubmit: false}).checkForm()) {
    jQuery(‘.gform_next_button’).prop(‘disabled’, false);
    jQuery(‘.gform_button’).prop(‘disabled’, false);
    } else {
    jQuery(‘.gform_next_button’).prop(‘disabled’, ‘disabled’);
    jQuery(‘.gform_button’).prop(‘disabled’, ‘disabled’);
    }
    });

    On next or previous page do also the validation:

    jQuery(‘.gform_next_button’).click(function(){
    jQuery(document).on(‘gform_page_loaded’, function(event, form_id, current_page){
    if (jQuery(form).validate({onsubmit: false}).checkForm()) {
    jQuery(‘.gform_next_button’).prop(‘disabled’, false);
    jQuery(‘.gform_button’).prop(‘disabled’, false);
    } else {
    jQuery(‘.gform_next_button’).prop(‘disabled’, ‘disabled’);
    jQuery(‘.gform_button’).prop(‘disabled’, ‘disabled’);
    };
    });
    });

    jQuery(‘.gform_previous_button’).click(function(){

    jQuery(document).on(‘gform_page_loaded’, function(event, form_id, current_page){
    if (jQuery(form).validate({onsubmit: false}).checkForm()) {
    jQuery(‘.gform_next_button’).prop(‘disabled’, false);
    jQuery(‘.gform_button’).prop(‘disabled’, false);
    } else {
    jQuery(‘.gform_next_button’).prop(‘disabled’, ‘disabled’);
    jQuery(‘.gform_button’).prop(‘disabled’, ‘disabled’);
    };
    });

    });

    And finally add an additional option on the jQuery(this).validate({ …, onsubmit: false })

    #452662
    Dinesh
    Keymaster

    Hi,

    We have updated our plugin to 1.19 and this should fix the issue for both Previous, Save & Continue button.

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Some issues – Multi step form + save & continue’ is closed to new replies.