Need help in making submit button disable on service portal (record producer)

sravya03
Tera Contributor

Need help in making submit button disable on service portal based on a yes/no type variable.

I have tried writing onsubmit catalog client script but not working.

3 REPLIES 3

Eswar Chappa
Mega Sage
Mega Sage

Hi @sravya03 please go through the below community article:

 

https://www.servicenow.com/community/itsm-forum/how-to-hide-ui-action-button-on-change-of-field-valu...

 

Please, Mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards,

Eswar Chappa

 

Sagar Pagar
Tera Patron

Hi @sravya03,

 

Take a look at old thread. Apply the same solution to hide the submit button based on conditions.

Remove/disable/hide record producer Submit button. 

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
       return;
    }
 
    if(newValue == 'value you want to hide the submit button for'){
        document.getElementById("submit_button").style.display = 'none';
    }
    else{
        document.getElementById("submit_button").style.display = '';
    }
    
 }

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers! 👍🏻
Thanks,
Sagar Pagar

 

The world works with ServiceNow

Hi @Sagar Pagar 

That code is throwing java console error.

Below is my code...variable is yes/no and if variable value is yes then submit should be disabled on SP.

sravya03_0-1692805974731.png