In a SharePoint 2016 list, I have a choice column (appropriately named 'Choice') where I would like to hide certain values in NewForm.aspx.
- Choice 1
- Choice 2
- Choice 3
(I'm trying to hide Choice 2.)
I've got jQuery saved in the Site Assets document library on this same site, and the following script (called "HideChoices.js")
<script src="../SiteAssets/jQuery/jquery-3.3.1.min.js">
$(document).ready(function() {
var dropdown = $(":input[title='Choice']");
dropdown.find("option[value='Choice 2']").remove();
});
</script>
I added a link to HideChoices.js to the main web part on NewForm.aspx, but it breaks and I'm not really sure where I'm going wrong.