I'm haggling over how to "hide" 2 columns when a specific column drop down answer is "No". Assuming I use JS, would I save the script in Site Assets and refer the link on CEWP? Here's the script I found and am also wondering if I need to download SPUtility.js? I work for a gov't contractor and am not sure I can upload that on my Style Library. Here's the script & not very savvy with JS. Thx!
<script src="http://code.jquery.com/jquery-1.7.2.min.js" type=text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
// col1 is hidden by default , col2 is visible
$('nobr:contains("col1")').closest('tr').hide();
// Show/hide columns based on Drop Down Selection
// hide col2 and show col1 when selecting "dropdown option 1"
$("select[title='dropdown column name']").change(function() {
if ($("select[title='dropdown column name']").val() == "dropdown option 1") {
$('nobr:contains("col2")').closest('tr').hide();
$('nobr:contains("col1")').closest('tr').show();
}
// hide col1 and show col2 when selecting "dropdown option 2"
else if($("select[title='dropdown column name']").val() == "dropdown option 2"){
$('nobr:contains("col1")').closest('tr').hide();
$('nobr:contains("col2")').closest('tr').show();
}
});
});
</script>