Hi the forum,
In a multi-language environment, is it possible to select the "after form submission" text in function of the language selected by the user? I tried to translate the sentences in the multi-language dialogbox but without results.
Thanks for the answers
Regards
Tom
In a multi-language environment, is it possible to select the "after form submission" text in function of the language selected by the user? I tried to translate the sentences in the multi-language dialogbox but without results.
Thanks for the answers
Regards
Tom
Hi Tom,
Use a switch statement in the box:
Bob
Use a switch statement in the box:
<?php
$lang =& JFactory::getLanguage();
switch ( $lang->getTag() ) {
case 'en-GB':
default:
echo "Some text in English";
break;
case 'fr-FR':
echo "Certains textes en français";
break;
case 'xx-XX':
echo "xxx xxx xxx xxx";
break;
}
?>
Bob
Hi Bob
Thanks for your answer but she is to complex for my simple mind.
Do you mean that I have to put the code in the confirmation page parameter as shown in the picture?
Or do you mean something else with the sentence "Use a switch statement in the box" ?
Regards
Tom
Thanks for your answer but she is to complex for my simple mind.
Do you mean that I have to put the code in the confirmation page parameter as shown in the picture?
Or do you mean something else with the sentence "Use a switch statement in the box" ?
Regards
Tom
Hi Tom,
Open the form in the Form Editor (not the Wizard Edit) and put the code in the OnSubmit After Email box on the Form Code tab.
Bob
Open the form in the Form Editor (not the Wizard Edit) and put the code in the OnSubmit After Email box on the Form Code tab.
Bob
Hi Bob,
Done and works fine. Although I don't know PhP, I'll try to modify the code for a better layout.
Can I use for example {text_2} coming from the form as variable in your PhP code and concatenate (.) it with text? For example: echo "Hello" . {text_2}
I think that only two problems remain:
How can I avoid the empty space between the title of the form and the form. It is equal to the height of the main menu.
The data corresponding to the added fields are still empty in the table. I added a zipped backup in a previous answer.
Once again, thanks for your advices and your patience.
Tom
Done and works fine. Although I don't know PhP, I'll try to modify the code for a better layout.
Can I use for example {text_2} coming from the form as variable in your PhP code and concatenate (.) it with text? For example: echo "Hello" . {text_2}
I think that only two problems remain:
How can I avoid the empty space between the title of the form and the form. It is equal to the height of the main menu.
The data corresponding to the added fields are still empty in the table. I added a zipped backup in a previous answer.
Once again, thanks for your advices and your patience.
Tom
Hi Tom,
I don't think that you can use the {input_name} syntax in the OnSubmit boxes (I could be wrong though).
I'd use
The spacing problem typically is coused by one (or more) of these:
[list]An unclosed <div> in the form code The height:auto; entry in the form CSS A page element like an image - tha tis too wide for the column. [/list]
Bob
I don't think that you can use the {input_name} syntax in the OnSubmit boxes (I could be wrong though).
I'd use
<?php
$input_name = JRequest::getVar('input_name', '', 'post');
echo "Hello" . $input_name;
?>
The spacing problem typically is coused by one (or more) of these:
[list]
Bob
This topic is locked and no more replies can be posted.