Remove/disable/hide record producer Submit button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2020 03:12 AM
Hi ,
Is there any way to remove/hide or disable 'Submit ' button on a record producer using catalog client script onLoad/onChange and also preferably not doing DOM manipulation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2020 03:47 AM
Using DOM manipulation code is showing Javascript browser console error for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2020 03:50 AM
Can you share the error? Have you tried both versions?
Also try getElementByName:
Either:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'value you want to hide the submit button for'){
document.getElementsByName('submit').style.display = 'none';
}
else{
document.getElementsByName('submit').style.display = '';
}
}
Or:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'value you want to hide the submit button for'){
this.document.getElementsByName('submit').style.display = 'none';
}
else{
this.document.getElementsByName('submit').style.display = '';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 01:19 AM
How to hide on now mobile (mobile terminal)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2020 03:29 AM
Hi,
Why would you like to remove it?
If you remove it then for what purpose the record producer will be used by end users?
If you want to disable it for specific record producer then you would require DOM manipulation which is not recommended.
you can use onLoad client script as below for your record producer
ensure isloate script is set to false for this onLoad client script
function onLoad(){
document.getElementById("submit_button").style.display = 'none';
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2020 03:44 AM
Thanks Ankur!
I tried above solution, but it did not work for me.
Also, there is Javascript console error shown.