How to hide multiple choice option on the form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 01:21 AM
Hi,
Requirement : To hide multiple choice option based on other field change
I tried with onChange client script. Checked using g_form.removeoption, setDisplay, setVisible. But not able to hide the radio button.
Is there a way to hide the radio button?
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 04:03 AM
Hi, I tried it using client script, but not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 01:28 AM
Hi,
You cannot use g_form.removeOption for a multiple choice type of variable(radio button).
You have below options :
1) Use select box(dropdown) instead of multiple choice variable
2) Create two different radio button variables with same name in which one has all options, and other radio button has only few options(dont include options you need to hide)
Then write an onchange client script to show the first or second variable based on selection.
3) You can write a global ui script and use it in client script to disable the option instead of hide.
http://www.servicenowguru.com/scripting/client-scripts-scripting/removing-disabling-choice-list-opti... has that script
Mark as correct or helpful as applies
Regards,
Sumanth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 01:59 AM
You have to use DOM manipulation, which is never a good idea
There's a workaround that you can try
you can have more than one multi choice fields, for eg
Request Type(req_typ_1) ->
- New
- Update
- Delete
Request Type(req_typ_2) ->
- New
- Update
Use to hide/show on your condition, by this you can prevent using DOM manipulation which I think is a win - win.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 05:13 AM
Aman Kumar