How to “hide” a dropdown/lookup field in NewForm.aspx
-
19-02-2021 - |
Question
I'm trying to hide a dropdown field in my SharePoint 2013 NewForm.aspx page. I figured out how to hide text boxes by adding the following code snippet for a text box called "Name". However, when I try do do the same on a dropdown box that looks up job titles from another list, I can't seem to figure out how to hide that dropdown/lookup. What am I missing?
$('input[id*="Name_"]').closest("tr").hide();
Solution
To hide a SharePoint column of the type choice - drop-down the HTML control will be a select
field instead of input
.
Simply,
$('select[id*="Name_"]').closest("tr").hide();
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange