How to disable UI Action on a Form with particular condition and reverse it false

sanjeev28 k
Giga Expert

I have a cancel button on problem form, the requirement is like - if a check box field on the problem form is checked then , cancel button will become disable and if I uncheck the field then cancel button will be enabled again

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Sanjeev,



You can have a OnChange client script and then based on the condition you can show or hide the button. Please refer the below thread and adjust your solution accordingly.


http://www.servicenowguru.com/scripting/client-scripts-scripting/removing-form-buttons/


View solution in original post

9 REPLIES 9

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Sanjeev,



You can have a OnChange client script and then based on the condition you can show or hide the button. Please refer the below thread and adjust your solution accordingly.


http://www.servicenowguru.com/scripting/client-scripts-scripting/removing-form-buttons/


Thanks Pradeep,



I will try and update you on this


Hi Pradeep,



I got how to remove button if the field is checked, but now want to know how to bring it back when the field is not checked


Remove hide with show in the script.