Hi Jacob,
Firstly, thank for you for a great module. We use it quite extensively on a client project. We have quite complex flow with wizard pages and conditional logic, and this module works flawlessly.
With our user base we have done some testing and found that a wide majority of them tend to click the browser back button when they are on a form with many wizard pages. Initially we had disabled the browser back button, but this was confusing the users.
So, in the spirit of giving back, we extended the functionality of webform to provide additional form behaviour. Where, clicking the back button in the browser will actually click the "Previous Page" button provided by the page wizard.
Here is how it looks in webform settings page.
Keen to hear your thoughts on incorporating this functionality into webform.
Comment | File | Size | Author |
---|---|---|---|
#22 | option2.patch | 628 bytes | mattgill |
| |||
#22 | option1.patch | 359 bytes | mattgill |
| |||
#17 | 2920443-17.patch | 158.66 KB | jrockowitz |
| |||
#17 | interdiff-2920443-15-17.txt | 110.34 KB | jrockowitz |
#15 | interdiff-2920443-1-15.txt | 14.31 KB | jrockowitz |
Comments
Comment #2
dakku CreditAttribution: dakku commentedComment #3
dakku CreditAttribution: dakku commentedUnder the hood of all webform wrapper settings etc, this is what the core of the patch actually implements:
Comment #5
dakku CreditAttribution: dakku commentedinterestingly the coding standards that seem to have failed the tests are not related to this patch. So, ignoring the failure for now.
Comment #6
dakku CreditAttribution: dakku commentedComment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThis is a good idea and very clean patch.
One immediate thing that should done is to create a test form that can be used for manual testing.(webform/tests/modules/webform_test/config/install/webform.webform.test_form_wizard_back_submit.yml)
.
I think we should change 'form_browser_back' to be named 'form_submit_back' which contains the two keywords of this feature, "Browser Back Button to submit to previous wizard page"
Maybe the label should be changed "Browser back button submit" to "Submit form when browser back button is clicked"
Comment #8
dakku CreditAttribution: dakku commentedHi Jacob,
Thanks for the feedback, Naming thing is indeed hard :)
I will incorporate your feedback and re-roll a new patch in the next day or so.
Comment #9
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented@dakku Absolutely no rush. I am reassigning this ticket to you.
Once, you have the test form setup. we can do some cross-browser testing.
Comment #10
dakku CreditAttribution: dakku commentedHi Jacob,
Can we try this one?
it incorporates:
Comment #12
dakku CreditAttribution: dakku commentedseem to have failed the tests are not related to this patch. So, ignoring the failure for now.
Comment #15
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedLooks pretty good.
Basically, I tweaked the patch to also fix the preview page's back and adjust the help text.
Once all the tests pass, I will generate the final patch that adds the 'form_submit_back' setting to all exported webforms.
Comment #17
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #18
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #20
dakku CreditAttribution: dakku commentedHi Jacob,
Thank you for getting this one committed.
I will create a new patch should we find any cross browser issues. For now, all looks good.
Comment #21
dakku CreditAttribution: dakku commentedHi Jacob,
Just noticed that the latest patch https://www.drupal.org/files/issues/2920443-17.patch is now using jQuery, but its missing the library dependencies to include jQuery.
Non JQuery
vs
jQuery
is there is need for us to use jQuery?
I think we can either:
- revert to using non jQuery method like in the original patch here https://www.drupal.org/files/issues/2920443-1.patch
or
- update the library dependencies to include jQuery
Which would be your preference? :)
Comment #22
mattgill CreditAttribution: mattgill as a volunteer commentedI'm adding two patches which may help!
Option1.patch - adds the jquery dependency to the libraries yml
Option2.patch - converts the code from jquery to pure js
Comment #23
dakku CreditAttribution: dakku commentedComment #24
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe webform module requires jQuery so I think we should "update the library dependencies to include jQuery".
Comment #25
dakku CreditAttribution: dakku commentedThanks Jacob, in that case, please see Option1 patch above, courtesy of Matt :)
Comment #27
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented