vendredi 23 octobre 2015

Sharepoint 2013: Show/Hide field based on value of a multi-choice checkbox

I have a custom list which I need to show/hide a field based on the value of a multiple choice checkbox. I have the following code which works only for dropdown, can you please help me fix it for a multiple choice checkbox? Snapshot

// Execute the following JavaScript after the page has fully loaded, when it's ".ready"

$(document).ready(function(){

//Define which columns to show/hide by default

$('nobr:contains("Teaser")').parent('h3').parent('td').parent('tr').hide();
//$('nobr:contains("Headline")').parent('h3').parent('td').parent('tr').hide();

//Show/hide columns based on chechbox Selection  

$("select[title='Platform']").click(function() {
if ($("select[title='Platform']").val() == "Facebook") { 
$('nobr:contains("Teaser")').parent('h3').parent('td').parent('tr').show();
} else { 

$('nobr:contains("Teaser")').parent('h3').parent('td').parent('tr').hide();
} 
}); 
});</script>




Aucun commentaire:

Enregistrer un commentaire