[BUGFIX] Prevent go back by submit on enter 82/54282/3
authorFrank Naegler <frank.naegler@typo3.org>
Wed, 4 Oct 2017 09:06:25 +0000 (11:06 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 6 Oct 2017 11:31:00 +0000 (13:31 +0200)
The first button of type=submit is used by the browser if
the user hint <enter> in a form field. A form should only contains
one submit button, which is fixed now with this patch.

Resolves: #82668
Releases: master, 8.7
Change-Id: I43323dd89be67d18a2818faf11359151223458f1
Reviewed-on: https://review.typo3.org/54282
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Markus Sommer <markus.sommer@typo3.org>
Tested-by: Markus Sommer <markus.sommer@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/form/Resources/Private/Frontend/Partials/Form/Navigation.html

index dc83c31..d0d01f0 100644 (file)
@@ -4,7 +4,7 @@
                <div class="btn-group" role="group">
                        <f:if condition="{form.previousPage}">
                                <span class="previous">
-                                       <f:form.button property="__currentPage" value="{form.previousPage.index}" class="btn btn-cancel" formnovalidate="formnovalidate">{formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'previousButtonLabel')}</f:form.button>
+                                       <f:form.button property="__currentPage" value="{form.previousPage.index}" type="button" class="btn btn-cancel" formnovalidate="formnovalidate">{formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'previousButtonLabel')}</f:form.button>
                                </span>
                        </f:if>
                        <f:if condition="{form.nextPage}">