Thursday, 5 April 2007

SharePoint 2007: Creating a custom New Item and Edit Item for Lists

Kristian Kalsing explains how to do this on his blog.

  • Open the site in SharePoint Designer.
  • Browse to the list and open the 'NewForm.aspx' web form.
  • Click File > Save As... and give the form a new name such as 'NewFormEdited.aspx'
  • Delete the default List Form Web Part from the page.
  • Click 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 the newly added Data Form Web Part, delete any 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.