17 Replies · Latest reply on Oct 20, 2017 10:41 AM by Edwin Fuller

    Hide button with onChange Client Script?

      I have the below script that is currently not working. I need to hide the "Complete Task" button if the state changes to any of the following. "-940", "-941", "-942", "-943". Can someone help me correct this script?

       

       

      function onChange(){

          //If the incident type is 1,2,3

      }

       

      showCloseTaskButton('Convert to Request');

      function showCloseTaskButton(button) {

          if(g_form.getValue('state' == -940) || g_form.getValue('state' == -941 || g_form.getValue('state' == -942) || g_form.getValue('state' == -943)){

            

            

              //show the 'Convert to Request'

            

              var items = $$('BUTTON').each(function(item){

                  if(item.innerHTML.indexOf('Complete Task') > -1){

                      item.show();

                  }

                

              });

          } }