How Can I Hide a Checkbox?

bahdol5098
Tera Contributor

How can I hide a checkbox field in a catalog task?

I’m currently using the code: g_form.setVisible('variable', false);

This works as expected when the variable type is "Yes/No," but it doesn’t seem to work for a checkbox field, which I prefer because it looks cleaner on the form. Any suggestions?

6 REPLIES 6

Hi @bahdol5098,

 

Was your issue resolved?
 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

Chaitanya ILCR
Kilo Patron

Hi @bahdol5098 ,

is the checkbox a mandatory variable?
if yes,

you should use  g_form.setMandatory('variable_name',false) with g_form.setDisplay('variable_name',false) (preffered) or g_form.setVisible('variable_name',false);

 

if it's not a mandatory variable it should work fine

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya