Created
September 23, 2018 01:41
-
-
Save isogunro/4fde737d8e514e8c491027d2936e4eaa to your computer and use it in GitHub Desktop.
This manipulates a SP list form using the DOM API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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