- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 01:33 AM
Hi Team,
We have check box field on form if check box is checked need to hide button without saving the form and if check box is unchecked need to show the button on form without using DOM .Any one Can help me..
Thanks
Elanraj
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 02:32 AM
Hi Elanraja,
1) Create a UI Policy --> Set Condition as field (check_box) is true
2) In the Script tab set Run scripts true
3) In the if condition write
$$('#action_name')[0].hide(); //This will hide the top button
$$('#action_name')[1].hide(); //This will hide the bottom button as well
4) In the else condition write
$$('#action_name')[0].show(); //This will show the top button
$$('#action_name')[1].show(); //This will show the bottom button as well
For reference,
check this How to hide/show an UI action on field changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2019 02:19 AM
Hi Deepthi,
I can see that you have used the Name and not the Action Name in the script. Also, if your Action Name is "Review Esignature Document" you have to change it to "review_esignature_document" and then use it like below:
Instead of $$('Review Esignature Document') it should be $$('review_esignature_document').
--
Thanks,
Nitish
PS: Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 04:01 AM
That code is jQuery which is DOM manipulation...
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 06:53 AM
Hi, Paul. I've been struggling with accomplishing the same requirement (hiding/showing button). Do you know anything else I can do that isn't DOM manipulation?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2020 06:39 PM
Hiding the UI action dynamically isn't a supported configuration in ServiceNow. Your only option is to use API outside of ServiceNow (aka DOM manipulation).
I would just tell the customer it is not supported by the vendor, and you have to write code that is unsupported and could cause issues when upgrading in the future. If the customer accepts that risk, go ahead with your custom code, and document it well.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2021 12:07 AM
Good Morning,
Can you try adding the "Isolate script" field to the UI Policy form and set it to false i.e. uncheck it.
Configure > Form Layout > Move field to the right of the bucket list
Try again.
It should be false to allow your DOM manipulation to work.
Kind Regards
Ashley