I've tried searching the issue queue for this, so apologies if this is a duplicate.
We have an issue on a site where we have a multistep webform, with required fields on each step. The user can navigate backwards to a previous step if they so wish.
The problem is that if a user fills clicks the back button without filling out all the required fields on the current step, then they get a "X field is required" type messages. We'd like to be able to not trigger the validation checks if the back button is pressed, but still retain those checks if the user clicks Next.
Is there any way to disable the validation checks on the back button?
Comment | File | Size | Author |
---|---|---|---|
#14 | webform.webform.example_wizard.yml | 3.61 KB | jrockowitz |
#11 | back_previous_button-2854871-11.patch | 1.11 KB | jrockowitz |
#2 | back_previous_button-2854871-2.patch | 539 bytes | jrockowitz |
|
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe is very old issue that I was almost certain was fixed. I really need to get JavaScript testing setup.
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI committed the patch. Please download and review the latest dev release.
Comment #6
Courtenay CreditAttribution: Courtenay commentedHi,
I still have this same issue using version Webform 8.x-5.x - i can see in the webform.form.js file that the "patch" is in there...
Thanks
Comment #7
scoff CreditAttribution: scoff commentedI still have this using 8.x-5.0-beta15
To reproduce make any field on step 2 of the "Example: Wizard" form required and then try step one - step two - back to step one.
Comment #8
scoff CreditAttribution: scoff commented8.x-5.0-beta16, same as above
I think HTML5 novalidate works fine and there's no client-side validation if I click Back, but after the form is submitted there's still server side validation which displays a message and prevents me from actually going back until I fill out the required field.
Looks like a major issue to me.
Comment #9
duncan.moo CreditAttribution: duncan.moo commentedPer this issue I simply added the following:
-- do not use this solution, see below --
-- do not use this solution, see below --
Comment #10
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI think this needs to be added the wizard and preview previous buttons.
@see http://cgit.drupalcode.org/webform/tree/src/WebformSubmissionForm.php#n844
Comment #11
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #14
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedOnce, I started to look into the issue, I realized that using #limit_validation_errors causes major issues on complex wizard forms.
I added some notes explaining why the webform module is not using '#limit_validation_errors'.
@see http://cgit.drupalcode.org/webform/commit/?id=e6c1fa2
I can't reproduce the issue described in #7. Attached is the webform I am using the replicate the steps in #7.
Comment #15
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented