Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Why this JavaScript does not hide SharePoint EditForm.aspx fields?

$
0
0

Hi there,

I am using this JS to hide certain fields in my EditForm.aspx (MUST use JavaScript no alternative will do).

For some reason this does not hide SharePoint list fields. The script is as follows:

<script type="text/javascript" language="javascript" src="/Path/jquery-1.4.min.js"></script><script type="text/javascript" language="javascript" src="/Path/jquery.SPServices-0.5.1.min.js"></script><script type="text/javascript" language="javascript">
$(document).ready(function() 
	{
		_spBodyOnLoadFunctionNames.push("ShowHide");
		function ShowHide() 
		{
			var control = findacontrol( "Finance Department");
			control.parentNode.parentNode.style.display = "none"; //<------ This field is still shown surprisingly
		}
	}</script>

Any help will be appreciated.

Thanks.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>