Task #17626
closedJS-function checkSubmit should not use eval
100%
Description
The checkSubmit function in typo3/jsfunc.tbe_editor.js (used in backend forms) is in IMHO not correctly implemented.
The lines 260-264 checks if any user-defined javascript (registered with t3lib_tceforms->additionalJS_submit) should be evaluated before the form is submitted.
But it uses the eval-function to execute the javascript and this means that you cannot abort the submit in your own javascript-code (using "return false;") .
(issue imported from #M6392)
Updated by Oliver Hader about 17 years ago
Hi,
what do you mean with "abort the submit in your own javascript-code"? Could you please give an example?
We cound integrate another check before line 266, e.g.
if (STOP) { return false; }
So, you can add e.g. the following to t3lib_TCEforms->additionalJS_submit:
if (!MyValidatorObject.someFunction()) { STOP = true; }
Updated by Mads Brunn about 17 years ago
Hi,
Yes, that's exactly what I had in mind.
I want e.g. to do a check on a specific field and if it doesn't have a specific value the submit should be aborted.
Btw. I think this used to work in version 4.0 but back then the code in t3lib_TCEforms->additionalJS_submit was simply injected directly in the onsubmit function.
Updated by Andreas Wolf about 13 years ago
- Tracker changed from Bug to Feature
- Subject changed from JS-function checkSubmit not correctly implemented to JS-function checkSubmit should not use eval
- Category set to FormEngine aka TCEforms
- Status changed from New to Accepted
- Assignee set to Andreas Wolf
- Target version deleted (
0)
I guess this is more a feature than a bug... But we should definitely have it.
Updated by Mathias Schreiber almost 10 years ago
- Assignee changed from Andreas Wolf to Frank Nägler
Could you check during your FormEngine crusade, please?
Updated by Frank Nägler over 9 years ago
- Target version set to 7.4 (Backend)
- PHP Version deleted (
4.3)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Target version changed from 7.5 to 7 LTS
Updated by Gerrit Code Review about 9 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43743
Updated by Gerrit Code Review about 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43743
Updated by Gerrit Code Review about 9 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43743
Updated by Gerrit Code Review about 9 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/43743
Updated by Frank Nägler about 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 00f93bdfce63210ff3aa7fe762fb4c6e3f6a17d5.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed