Creating Dynamic Radio Buttons for Multi-Choice Variable base on Preferred Lang

Peter Williams
Kilo Sage

Good day everyone,

 

i want to be able to use an onLoad client script to change the Multi-Choice Radio text and values base on the users preferred Lang using an onLoad CLient script

 

i have this so far but doesnt seem to work 

 

function onLoad() {


 
  if(g_lang =='fr'){
   
    g_form.removeOption('the_document_back', 'To be returned by internal mailing', 'To be returned by internal mailing', 1);
    g_form.removeOption('the_document_back', 'Pick up at Multi-Technology Center', 'Pick up at Multi-Technology Center', 1);
    g_form.addOption('the_document_back', 'à retourner par courrier interne','à retourner par courrier interne',1);
    g_form.addOption('the_document_back', 'récupérer à Centre Multi -Technologies','récupérer à Centre Multi -Technologies',1);
   
  }
}
 
i have it working for Select Box Variables but not Multi-Choice.
reason for this, i want the French Values to come through on the email notifications when its sent
4 REPLIES 4

Ahmmed Ali
Mega Sage

Hello @Peter Williams 

 

You can add the language translation for each choice to show on the form. For notification, I would suggest to write a script to print values in notification based on user's language.

 

Thank you,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Peter Williams
Kilo Sage

Yes i know how to do that but it would be alot of If statements in the email script.

i am trying to figure out something easier like an onLoad script or onSubmit 

 

any suggestions on that?

Instead of if conditions, you can create additional string variable in your catalog item and create an onsubmit client script to store display value of the field in that variable, now in your notification use that variable to print value. 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

seem to be alot of unnecessary work to just do this

is there any other simpler way?