How can we disable SUBMIT button on Service portal and ITIL view when we select particular value on catalog variable on a catalog item

Venkat141
Tera Contributor

How can we disable submit button on Service Portal view as well as ITIL view when we select Particular value under catalog variable on the catalog form

 

@Ankur Bawiskar 

@Saurav 

@shloke04 

@Anil Lande 

@Maik Skoddow 

@Jaspal Singh 

@Sandeep Dutta 

@Chandra Sekhar Maganty 

@Musab Rasheed

12 REPLIES 12

shloke04
Kilo Patron

Hi,

Instead of disabling the button which will be like customization to core OOB widget you can write a On Submit client script on your catalog item and restrict form submisision and your purpi=ose will be solved like below sample script:

Create a Catalog Client script of On Submit Type :

function onSubmit() {
    //Type appropriate comment here, and begin script below
    if (g_form.getValue('Variable Name') == 'Value here') {
        return false;
    }
}

find_real_file.png

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use onSubmit catalog client script and stop the form submission

Showing/hiding the button would require DOM which is not recommended

Regards
Ankur

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

Hi,

if you still require to show/hide the button then this link has script solution

Remove/disable/hide record producer Submit button.

Regards
Ankur

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

@Pavan Ramireddy 

Did you get a chance to check the above link which has script to show/hide?

Regards
Ankur

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