Custom Edit Forms for SharePoint 2007 Lists
What a coincidence: last week a student asked a question that I couldn’t answer straight away and probably at the same time somebody posted a blog post solving the question! The question was how to customize the edit form that you get when you create or edit a list item in a SharePoint 2007 list (EditForm.aspx). In SharePoint 2003 you could do this trick by editing the page in FrontPage 2003, when your right clicked on the control on the page you could actually break the control into different controls. Optimistically I tried to do the same thing in the SharePoint Designer, although the right click menu didn’t show to option that I was looking for (there went my street credibility for that course :-) ). Kristian Kalsing explains it on this blog post how this works in the 2007 world:
- Open your site in SharePoint Designer.
- Browse to your list and open the 'NewForm.aspx' web form.
- Go File > Save As... and give the form a new name such as 'NewForm2.aspx'.
- Delete the default List Form Web Part from the page.
- Go Insert > SharePoint Controls > Custom List Form.
- In the List or Document Library Form dialog, select the appropriate list, content type and type of form.
- Click OK and a new Data Form Web Part is added with controls representing all the fields from the list (in my environment all the controls show "Error Rendering Control" but this does not affect the final result).
- In the newly added Data Form Web Part, delete the rows containing fields not to be shown to the user (ensure that fields being removed are not required fields without default values as this would prevent the user from submitting the form).
- At this point, you can do other customisation such as rearranging the fields if you wish.
- Save the site.