Home › Forums › Jquery Validation For Gravity Forms › Some issues – Multi step form + save & continue
- This topic has 2 replies, 2 voices, and was last updated 1 year, 10 months ago by Dinesh.
-
AuthorPosts
-
May 20, 2022 at 10:28 am #451565KevinGuest
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!
May 25, 2022 at 3:51 pm #451975Kevin KnollmeierParticipantHey 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 })
June 2, 2022 at 4:15 pm #452662DineshKeymasterHi,
We have updated our plugin to 1.19 and this should fix the issue for both Previous, Save & Continue button.
Thanks
-
AuthorPosts
- The topic ‘Some issues – Multi step form + save & continue’ is closed to new replies.