I have a survey list. I need to hide a particular question by placing javascript in a content editor webpart. Can anybody give me the proper javascript code to hide the question in the survey list?
Hiding Sharepoint Survey List fields
4k views Asked by Srikanth At
2
There are 2 answers
0
On
The People Picker is a little trickier to pin down due to the way it is rendered in the browser, try something like this
var searchText = RegExp("FieldName=\"[YOUR PEOPLE PICKER NAME]\"", "gi");
$("td.ms-formbody").each(function() {
if(searchText.test($(this).html()))
{
$(this).find("div[Title='People Picker']").css('display', 'none');
return false;
}
});
Though I'd suggest using JQuery and traversing up the dom from the element you want to hide, to hide the thjat the element is contained within. In which case, load the JQuery JS file and use something like: