Need to show/hide a field based on the check box variable selection

rog
Giga Contributor

HI all,

 

I have created a variable set of with the type of variables as check box. Thre were 7 checkbox variables.

 

Now I have created another variable in the same variable set which is text field.

Requirement: Now I need to show field only when a particular check box variable is selected.

 

I have created an UI policy on the same - when the check box variable is selected and the UI policy action as the text field is visible and mandatory.

 

But it is acting strangely, There were multiple check boxes and when the form is loaded the text field is coming as mandatory. when the check box other than the one needed is checked the text field is going non mandatory. . Should I go with a client script for this requirement because the variable is of check box?

1 ACCEPTED SOLUTION

Gajanan Birada1
Giga Expert

 

Hi,

if(newValue == true)

{

g_form.setDisplay('priority', false);   

g_form.setDisplay('your_field ',true);  add field name and display for true

 

add your field like this

 

 

}

View solution in original post

4 REPLIES 4

Gajanan Birada1
Giga Expert

use client script

g_form.hidefield('field' ,true/fasle);

 

 

use this method.

you mean by deactivating the ui policy and using on change client script? can you give me the whole script?

onchange client script

 

if(newValue == true)

 

{

g_form.setDisplay('your field Value',true);

g_form.setDisplay('priority', false);   

like this add your field 

}

Gajanan Birada1
Giga Expert

 

Hi,

if(newValue == true)

{

g_form.setDisplay('priority', false);   

g_form.setDisplay('your_field ',true);  add field name and display for true

 

add your field like this

 

 

}