My SharePoint Blog

Blogs On SharePoint Technologies


Search Site

Recent posts

Recent comments

Tags

Don't show

    Categories


    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Create a custom list form for a SharePoint list

    1. Open your site in SharePoint Designer.
    2. Browse to your list and open the 'NewForm.aspx' web form.
    3. Go File -> Save As... and give the form a new name such as 'NewForm2.aspx'.
    4. Hide the default List Form Web Part from the page (do not delete it!!).
      1. Right click the List Form Web Part -> Web Part Properties -> expand Layout -> check Hidden.
    5. Go Insert > SharePoint Controls -> Custom List Form.
    6. In the List or Document Library Form dialog, select the appropriate list, content type and type of form.
    7. 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).
    8. 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).
    9. At this point, you can do other customisation such as rearranging the fields if you wish.
    10. Save the site.

    To make the new form the default form:

        1. Open the site in SharePoint Designer.
        2. Right click the list in the Folder List and select Properties.
        3. Go to the Supporting Files tab.
        4. Use the Browse button to enter the path to your new Edit item form.

    Note: To redirect after the form is submitted, use the following syntax in your misc links that point to the new form...

    http://portal.example.com/Lists/YourList/NewForm2.aspx?Source=http://portal.example.com/redirectpage.htm

     


    Credit:

    http://kalsing.blogspot.com/2006/11/create-custom-list-form-for-sharepoint.html

    http://office.microsoft.com/en-us/sharepointdesigner/HA101191111033.aspx 

      

    Problems: ("Invalid page URL"), see these articles:

    http://support.microsoft.com/kb/935504

     

    Gotchas:

    • Do not delete the default List Form Web Part from the page, "Hide" it!  You will get "Invalid page URL" errors if you delete it from your modified newform.aspx.
    • I have discovered that if you create a new item (that uses your modified NewForm.aspx) in a folder of a list, the new item is placed at the root of the list rather than the folder your created the item in.  I have an open Microsoft Support Ticket on this and will update this blog when it resolved.  Update: The have now issued a known bug and put it on their "fix list".  No word on when it will be patched (probably next service release).

     


    Categories: SharePoint
    Posted by Kevin on Wednesday, January 09, 2008 1:43 PM
    Permalink | Comments (10) | Post RSSRSS comment feed

    Comments

    carla

    Tuesday, February 26, 2008 4:40 PM

    Have you discoverd a way to keep the attachment from breaking when you customize a form?

    Kevin

    Tuesday, February 26, 2008 4:43 PM

    Attachment?

    carla

    Wednesday, February 27, 2008 9:35 AM

    Yes the new and edit forms of a list (not document library) have an attachment link on the toolbar. However
    after customizing the new form, the attachment link on the form gives the error "This form was customized
    not working with attachment."

    Kevin

    Wednesday, February 27, 2008 9:56 AM

    I was not aware of that bug. I have confirmed it on my machine as well, however the message is slightly different and a javascript one...

    Error: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.

    PS - I have not made MS aware of this attachment problem in a customized NewForm.aspx.

    carla

    Wednesday, February 27, 2008 10:11 AM

    Hmm, haven't come across that error. But in my googling for an answer, I have come across comments that apparently
    microsoft is aware of this issue.
    Below is another blog i found surrounding this issue.

    blah.winsmarts.com/...e_for_a_SharePoint_List.aspx

    Kevin

    Wednesday, February 27, 2008 2:44 PM

    Thanks for the update. If you find a way, let us know.

    Marc Davis

    Monday, April 28, 2008 11:10 PM

    A solution to the Attachment problem exists! Please visit my blog for the workaround: cid-6d5649bcab6a7f93.spaces.live.com/blog/cns!6D5649BCAB6A7F93!130.entry

    Filip

    Wednesday, July 16, 2008 6:44 AM

    Hi!
    Really god job!
    I want to do something similar!
    I have a Sharepoint list and i want the list displays data from an sql database.

    I figured somethingusing a web part zone ...

    but its not really what i need.

    I'm creating a workflow using the workflow wizard of sharepoint designer and i want to have access on the data from the list(database).

    Do you think that is possible and how can i do that. If not is there any alternative?

    Thank you

    Kevin

    Wednesday, July 16, 2008 9:19 AM

    @Marc, Thanks for the note.

    @Filip, not sure what you are asking for here. It sounds like you are trying to do something not related to this thread. Sorry I can't help you here.

    Patiti

    Wednesday, August 13, 2008 12:04 PM

    Thanks a Lot - Needed this change last minute b4 a deadline.. Smile

    Add comment


     

    [b][/b] - [i][/i] - [u][/u]- [quote][/quote]



    Live preview

    Sunday, September 07, 2008 6:59 PM