Show/Hide Field

SParker12
Tera Contributor

Is it possible to create a checkbox to show/hide a field on a form? For example, once the checkbox has been selected the field disappears but when unselected it is visible. 

1 ACCEPTED SOLUTION

Brian Lancaster
Tera Sage

Yes you can do this with a UI Policy. Condition would be if checkbox = false, Then in the UI Policy actions you would add the field you want to make visible. As long as the UI Policy has reverse if false checked then it will automatically update the UI when some set the check box to true. You could also do this with a client script and g_form.setVisible.

View solution in original post

4 REPLIES 4

Brian Lancaster
Tera Sage

Yes you can do this with a UI Policy. Condition would be if checkbox = false, Then in the UI Policy actions you would add the field you want to make visible. As long as the UI Policy has reverse if false checked then it will automatically update the UI when some set the check box to true. You could also do this with a client script and g_form.setVisible.

Hi Brian,

 

Thank you for this. I tried and it worked

Please mark my answer as correct. This will help any others who may have this question.

Sagar Pagar
Tera Patron

Hi @SParker12,

I agree with Brian, you need to create an UI policy with conditions based on check box field and control the visibility of your field.

 

Thanks,

Sagar Pagar

The world works with ServiceNow