display selected checkbox info in text field

asd22
Tera Contributor

Hello.

 

I have 3 check boxed

1: [] 10usd

2: [] 20usd

3: [] 30usd

 

and a text field thats named "price"

I need a client script that displays the selected checkbox'es info in a text field so my users can with ease see the price of the selected box. 

8 REPLIES 8

Hey i was looking for a onchange.

So if i select checkbox 1 it displays in the textfield the info from checkbox 1 etc.

Rohini S Sane
Tera Guru

Hi @asd22 ,

 In script you can write on change client script for check box variable.

On change client script.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
g_form.setValue('text',newValue)
}
 
 
Please Mark Helpful.
 
Regards,
Rohini Sane

how do i do this when i have 3 checkboxes then? im new to this sorry.

@asd22 ,

You have to create multiple onChange client script for multiple check box variable.

 

 

Regards,

Rohini Sane