Show/hide the submit button on catalog item form based on select box

Are Kaveri
Tera Contributor

Hi,

 

we have the below scenario for one of our client.

 

based on employee type we need to show submit button to submit the request on service portal.

 

 

for this I have written client script on onload. But not understanding how to achieve this

if(g_form.getValue(employee_type) == ‘full time’){
show submit button

}else {don’t show}

please help me with the scripting 

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Are Kaveri 

are you sure Isolate script field is marked as False for your client script?

Share the latest script and what debugging have you done so far?

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

View solution in original post

10 REPLIES 10

@Ankur Bawiskar  @Harish KM  helped .now working expected.

did isolated script to false.

in script

 

function onLoad(){
var emptype = g_form.getValue(‘employee_type’);

if(emptype != ‘full time’){

var z = this.document.getElementsByClassName("btn btn-primary btn-block ng-binding ng-scope");
        z[0].style.display = 'none';
}
}