[BUGFIX] Prevent go back by submit on enter 11/54311/2
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 12:17:53 +0000 (14:17 +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/54311
Tested-by: TYPO3com <no-reply@typo3.com>
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}">