Autopopulating details based on selection

User_267
Tera Contributor

We have a multiple choice which has 3 options V1,V2,V3 ( attached picture for reference)

And when we select V1 -C1,C2,c3  checkboxes are visible.

And as I attached image we have three variables variable1,variable 2,variable 3.

If user selects V1 option and C1 checkbox then it should be updated in variable 1

If user selects V1 option and c2 checkbox then it should be updated in variable 1

If user selects V1 option and c3 checkbox then it should be updated in variable 1 

 

Or

If the user selects V1 option and C1,c2 checkboxes then C1 value in variable 1 and c2 value in variable 2

(For example- if the user first selected C1,c2 ,but later if they don't want C1 option then c2 value should be in variable1)

 

 

If the user selects V1 option and C1,c3 checkboxes then C1 value in variable 1 and c3 value in variable 2

  1. If the user selects V1 option and c2,c3 checkboxes then C2 value in variable1, and c3 value in variable 2
  2. (For example if the user selects c2,c3 due to the script it will be updated in variable 1 and variable 2, but if user unchecks the c2 then c3 value should come in variable 1)

Or

If the user selects V1,C1,c2,c3,c4 then C1 value in variable 1, c2 value in variable 2, c3 value in variable 3)

 

Similarly for V2 and V3

How can we do this using ui policy run scripts. Because we cannot right on change or in submit the value should be displayed on the variable 1, variable 2, variable 3 which are on the form.

 

 

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, I would use  onChange() client script(s) with the variable fields being set read only (probably with UI policy).
It might also be easier to manage the solution if 'Options' was a choice list with values being shown\hidden based on the 'Select' value.