Skip to content

Instantly share code, notes, and snippets.

@isogunro
Created September 23, 2018 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isogunro/4fde737d8e514e8c491027d2936e4eaa to your computer and use it in GitHub Desktop.
Save isogunro/4fde737d8e514e8c491027d2936e4eaa to your computer and use it in GitHub Desktop.
This manipulates a SP list form using the DOM API
/*Get a reference to the chief approve drop down box*/
var chiefApprove = document.querySelector("[id^='ChiefDocumentApproval']");
/*Attach an onchage event to drop down*/
chiefApprove.onchange = function(){
/*Grab the selected value*/
var aValue = chiefApprove.options[chiefApprove.selectedIndex].value;
/*Show and hide feedback field based on the selected value*/
if(aValue == "Approval with Feedback" || aValue == "Further discussion needed") {
/*Show box*/
chiefFeedback.parentNode.parentNode.parentNode.style.visibility = "table-row";
}else{
/*Hide box*/
chiefFeedback.parentNode.parentNode.parentNode.style.visibility = "hidden";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment