How To Hide Controls in Newitem,Edit and disp form of List in Sharepoint

Hi Guys,

here is the javascript to hide controls in New/edit/disp forms in sharepoint.
function findacontrol(FieldName) {
var arr = document.getelementByTagName(“!”);
for(var i=0;i

if(arr[i].innerhtml.indexof(FieldName) > 0 ) {
return arr[i];
}
}
}

function hideFields() {    



var control = findacontrol("Device Name");     
control.parentNode.parentNode.style.display="none";   
control = findacontrol("Comments");    
control.parentNode.parentNode.style.display="none"; 
control = findacontrol("Options");    
control.parentNode.parentNode.style.display="none"; }

Reference:
Thanks
Ronak
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s