Whenever you customize the default list forms (NewForm.aspx, Dispform.aspx, or EditForm.aspx) in SharePoint designer, never, ever, under penalty of torture using Ed Wood movies, ever, I mean ever, delete the default ListFormWebPart that is on those pages. Doing this will subtly corrupt how your list is defined in SharePoint and can cause you all sorts of grief.
The most minor problem I've seen is that you lose the ability to specify the Supporting Files for the list. Oh sure, it will look like you can set them and it will even save and refresh properly in Designer. However, SharePoint will simply ignore that and go right along showing the default files instead.
The bigger problem is that deleting the ListFormWebPart from the NewForm.aspx page can effectively disconnect the "New" option on the list toolbar resulting in the ever annoying "Invalid page URL" dialog box when anyone clicks on it. This is a known issue and the only way to fix it is to delete and recreate the list. Not Fun.
Instead, save yourself some grief when editing these pages and just leave those web parts on there and add a new DataFormWebPart above or below it and customize that to your liking.
Note: make sure that you insert the new web part into the existing WebPartZone or else you will lose the 'Edit Page' option for that page on the Site Actions menu.
Once you have the customizations you want in place, you will need to hide (not delete!) the original ListFormWebPart. To do this in Designer, simply change the IsVisible element in the WebPart XML to 'false'
Alternatively, you can hide it using a browser as well. Simply browse the page and edit it, either by using SiteActions -> Edit Page or by adding "&PageView=Shared&toolpaneview=2" to the querystring in the browser.
Then edit the web part properties for the original ListFormWebPart and hide it
This keeps the original web part on the page which keeps SharePoint happy. Your users only see the customized list view that you want them to see, which keeps everyone else happy.
One thought on “Lesson Learned While Customizing Newform.aspx”
I’ve used the toolpanevew=2 trick and a CEWP to set a defalt duration of 1.5 hours for new calendar events.
Avoiding SPD for simple hacks like this avoids having to worry about changes to the list not propagating to the new/edit forms.