Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

Common JavaScript to Disable Add & Review for Individual Services

Looking to disable the Add & Review button for a particular service? Here's how.....

This item is contributed through one of our newScale Service Design consultants. I know that there is another post in the site (contributed by Brandy DeMarco at McKesson) with some of this information, however, the actual JavaScript code didn't seem to survive the migration from our previous site to this new site.

Step 1: Create the JavaScript "CMN_DisableAddReview" noted below:

CMN_DisableAddReview() {
  if (Moment === 'ordering') {
    locateFormElement = function(name) {
      var firstChild = document.getElementById(name).firstChild;
      while (firstChild.nodeType != 1)
        firstChild = firstChild.nextSibling;
      for (var x = 0; x<firstChild.childNodes.length; x++)
        if (firstChild.childNodes[x].nodeType == 1)
          return (firstChild.childNodes[x]);
    };
   
    // Locates the Add & Review header parent object within the HTML DOM
    FormHeaderName = 'cheader';
    locateFormElement(FormHeaderName).disabled = true;
   
    // Locates the Add & Review footer parent object within the HTML DOM
    FormFooterName = 'cfooter';
    locateFormElement(FormFooterName).disabled = true;
  }
}

Step 2:  Add the JavaScript in only 1 of the service specific AFCs in the Active Form Behavior Tab for the form onLoad Event

Everyone's tags (1)
1 REPLY
New Member

Re: Common JavaScript to Disable Add & Review for Individual Ser

We didn't want people to see it and wonder what they were missing out on, so we disabled it everywhere.

JS_Hide_AddReview_Button() {

    for(i=0; i //    alert(document.forms["serviceForm"].elements[i].value)
    if (document.forms["serviceForm"].elements[i].value == "Add & Review Order") {
//    alert("Found it!");
     document.forms["serviceForm"].elements[i].style.display = "none";
    }
  }
}

It is set to add the script on all forms.

157
Views
0
Helpful
1
Replies