Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to hide some fields in my Display Form... I was using jQuery:

$(document).ready(function(){
   $("A[name = 'SPBookmark_Start_x0020_date']").closest("tr").hide();
});

But when the page loads, the fields are there.... so the fields are only hidden after javascript executes the code... this is a problem to me... some users CANT see this values...
Is there a way to not load some fields in Display Form?

share|improve this question
    
From Power Shell Script u can set ShowInDisplayForm Attribute to False. –  Harsh Bhavsar Sep 1 at 13:35
    
u can set it by SharePoint Manager also –  Harsh Bhavsar Sep 1 at 13:56
    
Is the actual requirement that only SOME users can't display the fields? This is a mayor point in the solution we should pursue. –  SPArchaeologist Sep 1 at 14:05

3 Answers 3

up vote 2 down vote accepted

It is simple like this.

SPUtility.GetSPField('City').Hide();

Please refer this question to show how to apply it.

Edit:

As far as you are concerned not only on the displaying and having high security concerns over the security of data, you better try something like creating another list with a one-to-one mapping. Then add a lookup column from first list to the second list and move the secured column from first list to second list. Then you can give a restricted permission on the second list. This will be the option as you cannot use SPD or even InfoPath.

share|improve this answer
    
yes this also hides the field... but the values are still there... if users go to html, he is able to see the values... and I dont want that users be able to see the values... –  Thiago Sep 1 at 15:56
    
So what if user create a personal view with that column in. He can see values of all the list items ryt? –  Malin De Silva Sep 1 at 15:58
    
no, users dont have permitions to create views –  Thiago Sep 1 at 15:58
    
Great then take the table row which includes the field you have, then set the innerHTML to empty. Still if someone use a tool like Fidler, he can see the response body and find the initial HTML sent. –  Malin De Silva Sep 1 at 16:02
    
yes, thats what I want to prevent –  Thiago Sep 1 at 16:03

The answer has already been given.

Either use Powershell to hide the field in Display Form (take a look at another discussion for some helpful guidance or at this page)

#Get the web and site column objects
$web = Get-SPWeb http://site
$column = $web.Fields["Column To hide"]

#Set the PushChangesToLists property for the changes to be applied
#to lists where the column has already been added
$column.PushChangesToLists = $true

#Change the ShowInEditForm and other properties and update objects
$column.ShowInEditForm = $false
$column.ShowInNewForm = $false
$column.ShowInDisplayForm = $true
£column.ShowInViewForms = $true
$column.Update()
$web.Update()
$web.Dispose()

Or Use Sharepoint Manager which is an essential tool for Sharepoint anyway and since it has a Graphical User Interface it is great for beginners too.

share|improve this answer

SharePoint Manager is a great tool , however if you are a beginner then its a bit dangerous too, you may make unintended changes. I can suggest another tool, SharePoint Site explorer or [SharePoint Insider for 2010/2013] (http://www.aurorabits.com/sharepointinsider) (not sure if it works for 2007). They have read-only and client side versions, you can first use the read-only one to investigate before making changes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.