3

Can you hide a column from users when they are submitting a new list item but still have the ability to update that column when using the view? I am trying to create a list where users will submit a request and then use a view to have my team work the request to completion and I cannot get fields with choice types to populate in my view unless they are visible at the time of submission. If I hide the column on the list, it also hides it on the view that I create.

5

Yes, if you use a content type for the list, you can set the field to hidden. Thie will make it so it does not appear on the forms. It will show up in the list view fields so it could be edited in line or in datasheet view. If you set the choice fields with a default value, that default value should be populated in the list view when you submit an item.

2

If you want to hide a column only from NewItem, EditItem or DesplayItem form you have two options:

a. With PowerShell

Enable Management of Content types in Advaced List Settings and Run the following script:

Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue
$web = Get-SPWeb -Identity http://....
$list = $web.Lists["ListName"];
$field = $list.Fields["FieldName];
$field.ShowInNewForm = 0;
$field.Update();
$web.Dispose();

b. By editing content types XML if you have a custom solution created with Visual Studio

There are attributes ShowInNewForm, ShowInEditForm,...

2

You have some options with SharePoint Designer...

If there is a field that I need to have hidden on the New Item form but not on the Edit Item form, I create a custom New Item form and delete the row that I don't need. I then just leave the Edit Item form alone.

If there are fields that I need to have hidden dependent on whether other information is filled out I create a custom form and use javascript to add an event handler to a field and hide/unhide other content. For example:

_spBodyOnLoadFunctionNames.push("fieldChanged");

function fieldChanged() 
{
    var objField = document.getElementById("FieldID");
    objField.style.display="none";

    objField.onchange = function()
    {
        if (objField.value == "ShowOnThisValue")
            {
                document.getElementById("dependentFieldID").style.display="table-row"; //or equivalent
            }
        else
            {
                document.getElementById("dependentFieldID").style.display="none";   
            }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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