Customize the "NewForm.aspx" page for a SharePoint List

Creating a SharePoint list is hella easy. Point and click - and bingo - you have a form to type in and maintain your data in a structure you specified, and you can then create various views on the data collected.

But what if you wished to customize either the "New" form, or the "Update" form etc?

In this blogpost, I will demonstrate how to customize the New form for the announcements list.

  1. Create an announcements list on your favorite sharepoint site.
  2. Open that site in SharePoint designer.
  3. Go to the announcements list on the left side in the treeview, find the "NewForm.aspx", right click on it, and choose "New from Existing page".
  4. Save that new page at the same level as NewForm.aspx, call it "NewForm2.aspx". (I am only doing this, so if you screw up NewForm2.aspx - you still have NewForm.aspx intact).
  5. Next, find the "PlaceHolderMain" webpartzone. Go ahead and default this WebPartZone to it's default content as shown below - 
     
  6. Next, using a similar smart tag, do "Create Custom Content" for "PlaceHolderMain".
  7. Next, with PlaceHolderMain selected, go to Insert --> SharePoint Controls --> Custom List Form. You will see a dialogbox like this --
  8. You know what to do .. Click OK :).
  9. Great, now you should see SPD reflect the form as follows - 
  10. Great, now I'm going to customize this form an WYSIWYG way, and knock off the "Expires". This is real easy frankly, just select the Expires Row, right click, Delete Rows - POOF!
  11. Save the NewForm2.aspx.
  12. Now, right click on the Announcements list in SPD, choose Properties, and go to Supporting Files, click on "Browse" under the "New Item Form", and choose "NewForm2.aspx".
  13. Hit OK.
  14. Go back to the browser, and add a new announcement, you should no longer see the "Expires" field as shown below - 

你可能感兴趣的:(SharePoint)