How to make checkbox read-only or greyed out

Rhonda Hill
Tera Contributor

Hello, I am requesting help on how to make a checkbox in a ServiceNow catalog item as "read-only" or for the checkbox to be greyed out / non- applicable through the UI policy. For the particular variable, it would be more of an informational, so the checkbox should not be enabled for the user to check or select the option.  

 

Current script:

 

Execute if True:

 

function onCondition() {
g_form.setVariablesReadOnly(true);

 

Execute if False:

 

function onCondition() {

}

1 ACCEPTED SOLUTION

Manmohan K
Tera Sage

Hi @Rhonda Hill ,

Since you only intend to display information to user, then instead of checkbox consider creating a Label Variable

They are intended to be used for displaying information to users and not for data collection from users

 

Please mark response as helpful and correct if it helps resolve the issue

Thanks !!!

View solution in original post

2 REPLIES 2

Manmohan K
Tera Sage

Hi @Rhonda Hill ,

Since you only intend to display information to user, then instead of checkbox consider creating a Label Variable

They are intended to be used for displaying information to users and not for data collection from users

 

Please mark response as helpful and correct if it helps resolve the issue

Thanks !!!

Rhonda Hill
Tera Contributor

Thank you - turns out this solution worked best for my use case.