- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 04:50 PM
Hi ServiceNow Community Developers,
Do you know if there is a way to make a form button read only (unclickable / greyed out) but still keep it on the form when the conditions for it to be clickable are not me. Basically I have a requirement to not hide the button when the conditions are not met but keep it on the form but make it unclickable. OOB behavior is you hide the button when the conditions for it to appear are not satisfied so that is not scaling well for me with this requirement.
Would you please advise if this is possible in ServiceNow and how can I accomplish it.
Thanks,
Johannes
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 06:06 PM
@Johannes Mweli Try the following script.
//Disable the 'Submit' button
var items = $$('BUTTON').each(function(item) {
if (item.innerHTML.indexOf('Create New Incident') > -1) {
item.disable();
}
});
Here is the end result.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 05:56 PM
Hi @Johannes Mweli ,
You can play with required condition which make it disable on form, there should be filed value on the form which required in the same state along with other condition to be fulfill for enable/disable this UI Action button.
Share mode details like form, table and condition.
-Thanks
Ashish
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 06:06 PM
@Johannes Mweli Try the following script.
//Disable the 'Submit' button
var items = $$('BUTTON').each(function(item) {
if (item.innerHTML.indexOf('Create New Incident') > -1) {
item.disable();
}
});
Here is the end result.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 06:51 PM
Good one @Sandeep Rajput 👍 , hope this will help to @Johannes Mweli
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 06:47 AM
Thank you so much @Sandeep Rajput it worked.