Sharepoint - Hide some fields in the NewForm.aspx for a custom list
You can access the field you want to hide via Powershell and set ShowInNewForm to false. This will hide this field in you NewForm
$web = Get-SPWeb webUrl
$list = $web.Lists.TryGetList("Listname")
if($list)
{
$field = $list.Fields["FieldName"]
$field.ShowInNewForm = $false
$field.Update()
}
$web.Dispose()
The best way is to open sharepoint designer and create a new custom "NewForm".
There the complete form is rendered as normal table structure. You can just put "style='display:none'" in <tr>
and you are done.
It's way easier than all of this, go to List Settings, go to advanced settings, "Allow management content types "Yes" go back to list settings. You should see "Content Type" as a link (usually right above columns) click that. It's essentially a view of the form. Now once there you will see a list of all your columns again. Click on the column title, and then on Change Content Type, look at Column Settings. You should see Required, Optional, Hidden. Go ahead and hide. This will keep you from having to use infopath or code it in Sharepoint Designer, and I don't know about your server, but everytime we do a code variation using Infopath it runs much slower on form load time.