Hide Options from Select Box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 07:34 AM
For the Create Incident form, I added Category as an option. I was able to add this option and it inserts into the Incident table. Success!
However, I only want a few categories available for our users to choose from in this form. We'll call these internal vs. external categories. How do I hide the internal categories?
After some research, I'm trying to use the onLoad function with the g_form.removeOption, but I can't seem to get it to work. This is my first time working with client scripts.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 08:22 AM
The category needs to be in small case
use category and not Category
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 08:27 AM
I've tried that before and it didn't work. I just tried again and it still doesn't exclude Backup Tapes from the Category drop-down. It seems like I'm missing something big picture or just really obvious.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 08:47 AM
Make sure the value of the choice is correct. You should be passing the value and not the label there.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 09:19 AM
Adding on Anurag's response:
g_form.removeOption('category', 'backuptapes'); //Please have choiceValue backuptapes in quotes and then try
removeOption(String fieldName, String choiceValue);
Name Type Description
fieldName String Name of the field.
choiceValue String The value stored in the database. This is not the label.
More details: GlideForm - Client
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2018 11:35 AM
Thank you both for your feedback! It's still not working. Here's the script that I've updated:
This is the Create Incident form where I've added the Category variable. As you can see, Backup Tapes are still there. I have many categories I would like to hide from the user. I open this form in a different browser and impersonated a non-itil_admin user.