One of the most frequent questions I’m asked is to customise a SharePoint list form, not just the page in general but the list items themselves albeit new, edit or display form. Often the reason is to surpress some fields that are visible by the end user, such as admin fields, or on occasion to display different fields to different users. However you need to apply this you will need to use SharePoint Designer, firstly I will show you and easy way to surpress fields using SharePoint Designers built in controls.
Custom List Form (static)
This is to amend the default list form, in this example I will use the new form. Firsly open the form in SharePoint Designer, either locate the form through the browser and through the file menu select “edit in SharePoint Designer”, or locate the form in SPD, (site > lists >your list > newform.aspx). This results in the below view, you will notice it does not look like the items in you list, it shows you a default view as it links back to the original list, by customising it you will no longer inherit any changes made to the list (i.e. new fields added will not be displayed). First need to get rid of the “listformwebpart”, you can either simply delete this or if you want to you can just mark it as hidden in the properties.

image of list form
Now you need to insert a custom list form into a cell by selecting insert > SharePoint Controls > Customs list form.

You will the be presented with the below, you need to select your list, then select which kind of form you are customising in this case, it is the new form.

You will notice you can see all of the list items on your form, you can simply delete the cells you don’t wish to be displayed, (probably best not deleting mandatory fields). Save and done!
Target list item fields.
You may require different fields depending on user, in this case you can use the above method, but create however many different view you need on the same page, you can just stack this down the page, but enter these is separate webpart (so you will have to insert some more webpart zones). Once save and you open in the browser you will then end up with a long list with multiple forms stacked up.
Now you can edit the page as it is customised, presuming you followed the above and inserted the various custom lists views into separate webparts you can now target the individual webparts at different audiences. You will need to take the time to create the SharePoint Groups in order to target. Once created you can Modify the webpart, then expand the Advanced option in the right hand menu, and the bottom field will allow you to select your target audiences.
Use Javascript instead?
You can produce the same results as above by using Javascript, the advantage of this is that you do not have to create these static list forms, so any changes you make to the list will be retained in the forms and you can tweak accordingly from the browser. You will still need to use SPD to create some webpart zones on the page so you can insert the Javascript into a content editor Webpart (CEWP), again you will need to create multiple zones if you wish to target. You just have to add the field names into the below as desired, you can just repeat the duel control lines below for as many fields as required (I use excel to save time formatting). Remember targeting audiences you will be to targeting the Javascript, the suppressing agent, worth keeping in mind, any that isn’t targeted will be universal
<script language=”javascript” type=”text/javascript”>
_spBodyOnLoadFunctionNames.push(“hideFields”);
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() {
// debugger;
var control;
// Add a line for each control to be hidden
control = findacontrol(“Your Title Field Name to Hide”);
control.parentNode.parentNode.style.display=”none”;
}
</script>




