none
How can I move the add new item to the top of my sharepoint list RRS feed

  • Question

  • How can I move the "add new item" to the top of my sharepoint list.  We have a lot of entries and they have to page all the way to the bottom to add a new item every time.

    Cletus51

    Saturday, February 16, 2013 12:57 AM

Answers

  • Unfortunately you can't move the "Add New Item" link to the top of the OOBT list view web part.

    An alternative approach is to add a Content Editor Web Part (CEWP) on top of the list view web part with the following HTML source. (assuming the list name = "custom")

    <a onclick='NewItem2(event, "/Lists/custom/NewForm.aspx"); return false;' href="javascript://">Add new item</a>



    Allen Wang | http://blogs.msdn.com/allenwang


    • Edited by AllenWang Saturday, February 16, 2013 5:06 AM update to use code block
    • Marked as answer by Portfoliodude Saturday, February 16, 2013 6:06 AM
    Saturday, February 16, 2013 5:05 AM

All replies

  • Unfortunately you can't move the "Add New Item" link to the top of the OOBT list view web part.

    An alternative approach is to add a Content Editor Web Part (CEWP) on top of the list view web part with the following HTML source. (assuming the list name = "custom")

    <a onclick='NewItem2(event, "/Lists/custom/NewForm.aspx"); return false;' href="javascript://">Add new item</a>



    Allen Wang | http://blogs.msdn.com/allenwang


    • Edited by AllenWang Saturday, February 16, 2013 5:06 AM update to use code block
    • Marked as answer by Portfoliodude Saturday, February 16, 2013 6:06 AM
    Saturday, February 16, 2013 5:05 AM
  • This worked perfectly...thanks!

    Cletus51

    Saturday, February 16, 2013 6:06 AM
  • Can you please provide a bit more detailed instructions on how to accomplish this?

    Thank you,

    Raffi

    Tuesday, November 5, 2013 3:38 PM
  • After adding the Content Editor Web Part:

    1. Click on "Click here to add new content".
    2. Go to "Editing Tools" tab --> "Format Text" tab --> "Markup" Section --> "HTML" drop down --> click "Edit HTML Source".
    3. In the pop-up window include the HTML code.

    I had to modify the code to the following to get it to work on my page.

    <a onclick="javascript:NewItem2(event, &quot;http://server/site/Lists/List Name/NewForm.aspx&quot;); javascript:return false;" href="javascript://">Add new item</a>

    The link had to be a fully qualified link for me, or at least once it worked I stopped trying to figure it out.

    I also added the following before this to include the "+" sign that is shown at the bottom of the page.

    <span style="; width: 10px; display: inline-block; height: 10px; overflow: hidden"><img alt=":" src="/_layouts/images/fgimg.png" style="; border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; top: -128px !important; left: 0px !important"/></span>

    Bryan

    • Proposed as answer by Jawann Monday, May 6, 2019 6:21 PM
    Wednesday, November 6, 2013 5:36 AM
  • Where do you locate this addressor find this info in SharePoint?: http://server/site/Lists/List Name/NewForm.aspx&quot

    Or do you just substitute the list name and server?

    Wednesday, February 8, 2017 9:57 PM
  • Hi, Bryan.

    I want to be able to redirect to a particular page after the item is added instead of the default behavior where it takes the user to allitems.aspx page. How can i do that ?

    I'm using sharepoint 2013
    Thursday, August 17, 2017 4:24 PM
  • Thanks a ton. I wouldn't have figured this out with just the top answer.
    Monday, May 6, 2019 6:21 PM