Forums

Cant send Form with german "Umlaute"

xtrapack 01 Feb, 2011
Hello
I've searched the forum but found no solution.

In Joomla 1.5 I w/ Chronofroms I've created a simple form. One Textfield, a EMailfield and a Textarea, cappcha, send- and restbutton.

But when I write in textfield a german "Umlaut" (like ä, ü, ö Ü ö) I cant send the form, cause of wrong caracter in textfield. In the textarea-field it is no problem. Only in textfield.

But I swiss we have names like Müller and i need a solution.

Please can u help.
Thanks a lot
Günter

PS. sorry for my bad english
GreyHead 01 Feb, 2011
Hi Günter,

This should be no problem. ChronoForms usually handles these characters with no problem. Is your site set to use the UTF-8 character set?

Please post a link to the form so we can take a quick look.

Bob
xtrapack 02 Feb, 2011
Hi Bob

Thank you for the fast answer.


I make just online for u, the website is not online now. We still working on it.

As i wrote, the problem is just in the Text-Input. In the Textarea-Input it works. The Error is only when I leave the field and the valitation proof the letter.

Thanks and regards

Günter
GreyHead 02 Feb, 2011
Hi Günter,

Ok I see, you are using 'validate-alpha'. Unfortunately validate alpha only allows [a-z][A-Z] no numbers, punctuation or special characters from any language.

Please see this thread for some fixes.

Bob
xtrapack 02 Feb, 2011
Hi Bob
Thank u very much for ur very fast answer.
Unfortunately, I do not know where I insert the code snippet.

May u can help me again.

Thx and regards
Günter
GreyHead 02 Feb, 2011
Hi Günter,

The solution is very easy. There is jsvalidation2.js file (components/com_chronocontact/js/jsvalidation2.js), just find which validation you need to change and write inside letters you need to be accepted - look down, letters are bold.



Bob
xtrapack 02 Feb, 2011
Hi Bob

I wrote [a-zA-ZüÜöÖäÄéè ] in the pattern and it works.

U great. Thx u very much.

regards from swiss

Günter
olum 22 Apr, 2011
Hello

I'm using the new version V4_RC1.8.
I can't get the "Umlaute" to work.
I changed the code in "auto_serverside_validation.php"
function validate_alpha($str, $form){
		if(isset($form->data[$str])){
			return preg_match('/^[äÄöÖüÜßa-z ._-]+$/i', $form->data[$str]);
		}
	}

but it doesn't work.

Wat else can I change?

Thanks
olum
GreyHead 23 Apr, 2011
Hi olum,

Seems to work OK here. Did you add an 'Event Loop' action to the OnFail event so that the for is reloaded when there is an error?

Bob

PS It might be better to use a custom Serverside validation rather than hacking the core code.

This seems to work OK:
<?php
$str = 'input_text_0';
if ( isset($form->data[$str]) && !preg_match('/^[äÄöÖüÜßa-z ._-]+$/i', $form->data[$str]) ) {
  $form->validation_errors[$str] = "Ungültige Zeichen verwendet.";
  return false;
}
?>
or, to extend to more than one input
<?php
$string_array = array(
  'input_text_0',
  'input_text_1
);
$valid = true;
foreach ( $string_array as $str) {
  if ( isset($form->data[$str]) && !preg_match('/^[äÄöÖüÜßa-z ._-]+$/i', $form->data[$str]) ) {
    $form->validation_errors[$str] = "Ungültige Zeichen verwendet.";
    $valid = false;
  }
}
return $valid;
?>

Bob
sunshineh 23 Jun, 2011
I have changed the jsvalidation2.js File

			if(field.hasClass('validate-alpha')){

				if( tmessage) { var message_validate_alpha = tmessage; }

				name.add( Validate.Format, { 

					pattern: /^[a-zA-ZüÜöÖäÄéè]+$/, 

					failureMessage: message_validate_alpha 

				});

				fieldsarray[fieldsarray_count] = name;

				fieldsarray_count = fieldsarray_count + 1;

			}


But I can't find any "auto_serverside_validation.php-File"

and the Umlaute are't working.

I also find out, that in the chronoform table the collation is latin1_swedish_ci and I can't change it into utf8_general_ci!

How can I do this??
GreyHead 23 Jun, 2011
Hi sunshineh,

The file you need is administrator/components/com_chronoforms/form_actions/auto_serverside_validation/auto_serverside_validation.php

Note that hacking ChronoForms files means that they may be over-written when you install a later release.

I think that you'll need to change the collation settings using PHPMyAdmin, ChronoForms just uses the current default setting.

Bob
sunshineh 23 Jun, 2011
Thank you for your fast answer!

I haven't a folder administrator/components/com_chronoforms!

in my administrator/components-Folder are only com_chronoconnectivity & com_chronocontact

What should I do?
If it is possible, I don't want to reinstall the versions because I don't want to make my forms and my settings again!
sunshineh 23 Jun, 2011
I also found out (with PHP My Admin), that some components creates tables in "latin1_swedish_ci" instead of "utf8_general_ci".

I converted them with the following SQL-sequence:
ALTER TABLE tablename
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

But where are the utf8-settings on my joomla installation?
GreyHead 23 Jun, 2011
Hi sunshineh,

The AutoServerSide validation only exists in ChronoForms v4 and you have v3.

There may be a collation setting in the Joomla! installation - I don't' remember. After that you would need to change it with PHPMyAdmin; I think that you can change the default setting for the schema. That would work for newly created tables.

Bob
This topic is locked and no more replies can be posted.