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

Are you trying to say that I have to write one more onchange client script in which I will use item.show()



if yes then I have tried this but it din't worked


This will be only one client script with if and else condition and yes item.show(); should work. I've tested on my instance and it is working fine.


Please replicate this on demo instance and point me to the instance if you are still blocked so that I can help you out.


This link does not work anymore 

masnsa
Tera Contributor

Please share your solution, I am facing the same issue

 

sanjeev28 k
Giga Expert

Thanks Pradeep,



I got it.


Its a great help!!