- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 01:03 PM
I have a catalog item that opens with one mandatory variable, a choice list, visible. Depending on which option is taken, other variables are exposed. If certain of the choices on the initial variable are taken we don't want the requestor to be able to submit the request.
The initial variable is mandatory, but since a choice has been taken that condition is met. Is there any way other than trapping via an On Submit CCS that I can prevent the user from submitting the request, e.g. dsiable the submit button?
Thanks for any suggestions.
:{)
:{)
Helpful and Correct tags are appreciated and help others to find information faster
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 04:11 PM
Hi again,
Tested it in my instance. I've created a field of type "Yes/No" to trigger to display or hide the "Submit" button
onChange() script on variable "error_selection" that I'm using to toggle to display or hide.
I've disabled "Isolate script" an set UI Type to "All".
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '') {
return;
}
if (newValue == 'Yes') { // hide submit button
if (window == null) { // service portal
var z = this.document.getElementsByClassName("btn btn-primary btn-block ng-binding ng-scope");
z[0].style.display = 'none';
} else { // ui platform
document.getElementById("oi_order_now_button").style.display = 'none';
}
} else { // display submit button
if (window == null) { // service portal
var y = this.document.getElementsByClassName("btn btn-primary btn-block ng-binding ng-scope");
y[0].style.display = 'initial';
} else { // ui platform
document.getElementById("oi_order_now_button").style.display = 'initial';
}
}
}
Execution results
1. Portal
Case display submit button
Case hide submit button
2. UI16
Case display submit button (using the default "Order Now" button)
Case hide submit button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2022 08:42 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 06:54 AM
Hi,
This gets asked from time to time and honestly, believe it or not, "hiding" the submit button can actually cause more problems. Like in the solution you've marked as correct, the box where the submit button would be is still visible, so then users start to think the UI is broken or something is wrong. Because in other catalog items the button is there, they're used to it, and prior to a certain selection, they saw it there, then it randomly disappeared.
It's better to guide the user and keep them informed versus breaking the UI in DOM manipulation, etc. and causing confusion, in my opinion.
Instead, you can simply provide feedback to the user when they go to submit that due to 'x' they can't submit. Something along those lines. So an onSubmit client script with field validation and then returning false.
In any case, if what you've marked as Correct for you is fine and working for you, then by all means go for it! 🙂 I just wanted to provide an alternate perspective as it's really not ideal to manipulate the DOM.
Thanks!
-Allen
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2023 03:44 AM
You can use g_scratchpad to pass information to onSubmit catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 05:49 AM - edited 08-05-2025 05:50 AM
We can also hide the Submit button on a catalog item without using a script by following these steps:
Go to the Service Catalog table (sc_catalog), search for the specific Catalog Item (sc_cat_item)
where changes are needed, then in the related list, modify the “No order now” field in the personalized list.
Please click Helpful if you find this information useful.