Bug #16164
closedOld Gremlin: Mail Form validation: solution of wrong Russian chars in JS pop-up
0%
Description
There is extension to correct this problem:
------------------------
Correct Form (onet_correctform):
When MAILFORM using with differ from English language (for example - Russian) there is problems occur connected with necessarily fields. When necessarily fields is not filled, JavaScript "formValidate" shows form labels after processing rawurlencode() function which distorting labels when they shows on alert-window in turn. This extention are using parallel array, where rawurlencode() is not in use, and labels outputs to validateForm JavaScript in clean sight. This extention actual for Typo3 3.7.0.
------------------------
But IMHO better to correct this problem in TYPO3 Core
Solution (thanks to Kit from forum www.typo3.biz)
Patch for t3lib/jsfunc.validateform.js
function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess) {
var formObject = document[theFormname];
// patch start
theFieldlist = decodeURI(theFieldlist);
// end
if (!formObj............
(issue imported from #M3527)
Files
Updated by Martin Kutschker about 18 years ago
I'm not sure what happens in TYPO3 4.0 in the FE. In the BE all rawurlencode/unecapse pairs have been removed. This should also happen in the FE as it is only needed for very old browsers.
AFAIR using decodeURI only works if the charset is UTF-8 as it is this what the functions does: convert an UTF-8 string that is escaped (with %) into the local charset of the page. So TYPO3 must deliver UTF-8 to make this patch work.
Updated by Kirill Klimov about 18 years ago
I could confirm the problem with TYPO3 4.0 with UTF-8 in FE.
onet_correctform does fix the problem!
Why not to integrate it in the core?
Updated by Andres Toomsalu about 18 years ago
Also badMess, goodMess and emailMess need to be properly decoded as these texts may also contain foreign characters. For example I'm having problems with emailform estonian strings containing äöüõ. decodeURI() helps as I use utf on site.
Updated by Valery Romanchev about 18 years ago
This is patched version of t3lib/jsfunc.validateform.js
that solve this problem for utf8
Updated by Kirill Klimov over 17 years ago
The patch is not present neither at 4.1 Beta 3, nor at trunk from today.
Would it be fixed until 4.1?
Updated by Dmitry Pikhno over 17 years ago
guys, please add this patch to the core
Updated by Alexey Boriskin over 17 years ago
I just had attached unified diff. Maybe it will help for commiting patch.
Updated by Kirill Klimov over 17 years ago
I have tried it with typo3-trunk from today (RC2) - it works.
Please, commit this change.
Updated by Kirill Klimov over 17 years ago
Please, take a look and create SVN patch request for this simple change.
Updated by Dmitry Dulepov over 17 years ago
Can some of Russian-speaking people provide an example of mailform configuration here (with russian chars)? Before doing so, switch browser charset of the page to windows-1251 or utf-8, please.
Updated by Kirill Klimov over 17 years ago
Here is it (in UTF8):
=======================================- Example content:
имÑ: | *name = input,40 |
Email: | *email=input,40 |
Сообщение: | *message=textarea,40,5 |
СвÑзатьÑÑ Ñо мной: | tv=check | 1
|formtype_mail = submit | Send form! |html_enabled=hidden | 0 |subject=hidden| This is the subject =======================================
Updated by Dmitry Dulepov over 17 years ago
Patch works well, I will send it to core team list
Updated by Valery Romanchev over 17 years ago
the patch solve the problem for utf-8 (force charset) sites, but produce js error for win-1251 sites (and probably this will be for German with ISO encoding)
So the problem looks not easy
I find the info
http://www.typo3.net/index.php?id=13&action=list_post&tid=45887
Updated by Kirill Klimov over 17 years ago
Patch is recalled due potential problems with various non-unicode encodings.
Why? Isn't it better to fix at least for UTF-8 sites instead of not fixing for all?
Updated by Dmitry Dulepov over 17 years ago
No, it is not better. Fix must not introduce new errors. This is a general typo3 rule.
Updated by Martin Kutschker over 17 years ago
The accompanying tslib_content-validateForm.diff will make patch3527.diff work for all charsets.
Note: that using decodeURI will break ancient browsers (but so does a getElementById).
Updated by Dmytro about 17 years ago
Was this patch applied? Cause I did not see it applied in TYPO3 4.1.2.
Updated by Jonas Felix over 16 years ago
That's great, we publish a patch which only needs a blink of an eye for a core developer to integrate you set it to duplicated and close it.
It's a old gremlin it's a bad bug it's fixed, so why doesn't it go into core?
It's great that your cleaning up the bugtracker so consequently but it would be also cool if you could integrate the working patches.
The working up to date tested patch (which not only fixes this problem) is located here:
http://bugs.typo3.org/view.php?id=5615
Updated by Francois Suter over 15 years ago
It seems enough to call decodeURI() on the field names, since field names are encoded with rawurlencode() in tslib_content.
Attached a new patch, submitted to the core list.