Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a multi page form Each page has several fields.
The form works well when no field is "required".
When any of the fields is "required" than it can't move from step 2 to step 3 and it always goes back to step 1.
There is no special validation to any of the fields.
No warning is shown that can indicate a problem.
This issue is also shown when running a the form test and also when running the form from a block.
If you need further details, let me know.
Comment | File | Size | Author |
---|---|---|---|
#22 | Request a quote YAML Form Demo Site.png | 161 KB | jrockowitz |
#20 | Example Wizard YAML Form Demo Site.png | 118.96 KB | jrockowitz |
#17 | Forms Settings YAML Form Demo Site.png | 1.23 MB | jrockowitz |
#15 | Screenshot 2016-10-20 11.16.58.png | 116.89 KB | willwh |
#9 | form_wizard_pages-2819087-9.patch | 1.88 KB | jrockowitz |
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz commentedI can't duplicate the issue please document the steps required to reproduce the problem, using the 'Example: Wizard' (/form/example-wizard)
Comment #3
robpowellI could not replicate this issue using Example: Wizard. There are two form validations happening, for all fields that have html5 validation they will pop an error on the page (text fields) and for those fields that don't (radios) they are caught by the server side val which pops the red error above the form. To test the form redirection, I had to add a radio button to step 2 but when the form failed I was not redirected to step1.
Attached is the devel > export form and a screenshot of the error on step 2.
I am testing on 8.x-1.x commit 83f20a7.
Comment #4
jrockowitz CreditAttribution: jrockowitz commentedIn the form's settings there is an option to 'Disable client-side validation'
Comment #5
jrockowitz CreditAttribution: jrockowitz commentedSomething is definitely wrong with radio button required validation.
Below animation shows the first and last name being deleted when the required radio buttons are not set.
Comment #6
jrockowitz CreditAttribution: jrockowitz commentedComment #7
jrockowitz CreditAttribution: jrockowitz commentedComment #8
robpowellGreat, I will test my form with my module disabled and look into making a smaller POC of the bug. I will have my results up by 5pm EST.
Comment #9
jrockowitz CreditAttribution: jrockowitz commentedI think the attached patch might solve the problem.
Comment #10
jrockowitz CreditAttribution: jrockowitz commentedComment #11
robpowellThis fix worked for me, thanks!
Comment #12
inbalj CreditAttribution: inbalj as a volunteer commentedThe fix worked for my as well. Thanks !!!
(BTW, you guys fixed it so fast...Excellent!)
Comment #13
willwh CreditAttribution: willwh at North Studio commentedHi guys,
I applied this patch, and I'm still having an issue with a form with radio buttons on it. The radio buttons are a simple Yes/No, and set as a required field.
If I try and submit the form without selecting an option, the form reloads, without submission or errors.
Anyone have any ideas on where I should be setting breakpoints, either in JS or PHP code? Thanks!
Comment #14
jrockowitz CreditAttribution: jrockowitz commentedPatch has been applied. Please try the latest beta or dev release.
Comment #15
willwh CreditAttribution: willwh at North Studio commentedjrockowitz, thanks. I've just installed beta21, and now I'm seeing the following on the forms I created: I looked over the config, and I don't see where these would be disabled?
Comment #16
willwh CreditAttribution: willwh at North Studio commentedI just tried with 8.1.x-dev, and now, I get a similar message, but only about a single field, in my case: "Upload document is a Managed file element, which has been disabled and will not be rendered."
Comment #17
jrockowitz CreditAttribution: jrockowitz commentedYou probably need to enable public files and the managed file element via the admin settings (/admin/structure/yamlform/settings).
Comment #18
willwh CreditAttribution: willwh at North Studio commentedjrockowitz, thank you, that sorted that issue. Although, after updating to the 8.1.x-dev, I'm still having an issue with submitting a form with radio buttons, that does not have a default value set, and is a required field. The form page just reloads without error.
Any ideas here?
Comment #19
jrockowitz CreditAttribution: jrockowitz commentedComment #20
jrockowitz CreditAttribution: jrockowitz commentedI updated the Example: Wizard form (/form/example-wizard) and required both radio elements and the required validation is working fine.
I then removed paging from the same Example: Wizard form and required validation is still working as expected.
Can you provide me with step-by-step example?
Feel free to export and upload the form. (https://www.youtube.com/watch?v=ejzx4D0ldl0)
Comment #21
willwh CreditAttribution: willwh at North Studio commentedHi jrockowitz,
Interesting, just creating a new form, and adding a Yes/No radio button element, as a required field, and I run in to this issue.
I'm going to get stuck in with a debugger tonight, but thought I'd drop form config in here in the event that is helpful in tracking this down.
Thanks very much for your input so far!
Comment #22
jrockowitz CreditAttribution: jrockowitz commentedThe form is working as expected for me.
Below is a screenshot of the Yes/No radios displaying a required error message.
Can you please document the steps needed to reproduce this issue?
Comment #23
jrockowitz CreditAttribution: jrockowitz commentedComment #24
jrockowitz CreditAttribution: jrockowitz commented