Remove/disable/hide record producer Submit button.

trupti3
Kilo Explorer

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.

23 REPLIES 23

Using DOM manipulation code is showing Javascript browser console error for me.

 

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 = '';
    }
    
 }

How to hide on now mobile (mobile terminal)

Ankur Bawiskar
Tera Patron
Tera Patron

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';

}

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks Ankur!

I tried above solution, but it did not work for me.

Also, there is Javascript console error shown.