.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Hiding fields on NewForm.aspx and EditForm.aspx, the easy way

Posted By:Sagar Pardeshi       Posted Date: February 10, 2011    Points: 15    Category: SharePoint    URL: http://www.dotnetspark.com  

Hiding fields on NewForm.aspx and EditForm.aspx, the easy way

script language="javascript" type="text/javascript">
function findacontrol(FieldName) {
   var arr = document.getElementsByTagName("!");
   // get all comments
   for (var i=0;i < arr.length; i++ )
      // now match the field name
      if (arr[i].innerHTML.indexOf(FieldName) > 0)
      {         return arr[i];      }
function hideFields() {
   var control = findacontrol("Title");
   control = findacontrol("Document Link");
   control = findacontrol("PublishDate");


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend