How do I change the URL users are sent to after they fill out a New Item form?

This is a common request, particularly if your site has quite a few lists. Rather than bogging your users down with navigating into (and out of) each list, you may want to give your customers a quick and easy way to jump from your site’s landing page into your list forms and then back to your site’s landing page. The steps would look like this:

  1. Customer comes to your SharePoint site.
  2. Customer sees on your landing page a list of the form(s) that apply to them. They click on a link to go to the form they need.
  3. They fill out the form and click Save.
  4. They’re automatically returned to your SharePoint site’s landing page.

The first 3 steps are fairly straightforward, but step #4 is interesting. Normally, you are automatically taken to your list’s default view when you fill out and save a new item request. We want to change this default behavior. We don’t want our users to be taken to our list’s default view, because they don’t need to see all our list data. We want them to find their form, fill it out and then return to where they started. Fortunately, there’s a quick way to alter your user’s default path. By creating a custom link to your form and modifying the link’s HTML code, you can force SharePoint to take your end-users back to their starting point once they’ve finished filling out their form.

There are a variety of ways to modify your hyperlinks, including making customizations via SharePoint Designer. This blog post focuses on building these custom hyperlinks with out-of-the-box SharePoint web parts. Since the process differs slightly for MOSS 2007 and SharePoint 2010, I’ve included setup instructions for both platforms.

MOSS 2007 setup

First, you need to obtain the hyperlink for your list’s New Item form. Here are the steps for capturing this URL:

  1. Go to your site’s landing page.
  2. Click on Site Actions > Edit Page.
  3. Click on one of the Add a Web Part buttons.
  4. Select your list and click on the Add button. A web part for your list will be added to your site’s landing page. (Don’t worry–we’ll delete this web part in just a minute.)
  5. Right-click on the Add new item link that displays in the bottom left-hand corner of your list view web part. When the pop-up menu appears, select Copy Shortcut.
  6. Now you’re ready to delete this list view web part. Click on your web part’s edit link and select Delete.

Now that you have your New Item form’s URL, you’re ready to customize the URL and add it to your site’s default.aspx web part page. (Note that the steps outlined below can be used to add custom hyperlinks to any SharePoint web part page. You are not limited to adding these links to your site’s landing page.)

  1. Go to your site’s landing page.
  2. Click on Site Actions > Edit Page.
  3. Click on one of the Add a Web Part buttons.
  4. Scroll down the list of web parts until you find the Content Editor Web Part. Select this web part and click on the Add button to add it to your page.
  5. When the web part gets added to your page, it will appear with an open the tool pane hyperlink. Click on the hyperlink to configure this new web part.
  6. When the web part pane appears, click on the Source Editor… button.
  7. When the text entry box appears, key in the HTML code shown below. Replace the text highlighted in yellow with the URL for your new item form. Replace the text highlighted in blue with the verbiage you want displayed as your link. Leave the text highlighted in pink–this is the magic code that will make your hyperlink return users back to your site’s landing page after they submit their form.
  8. Click Save to save your changes.

That’s it! Your first HTML link is ready to go. Test it out and validate that it is working as desired.

You may want to pretty up your Content Editor Web Part a little bit (e.g. change the name of the web part and add additional form links), but otherwise you are ready for business. Here’s a picture of my finished page:

And here’s a picture of my final Source Editor code:

Note that I added some additional HTML tagging around my links–just enough to create a bulleted list for my form links. You can add in as much (or as little) HTML tagging as you want.

SharePoint 2010 setup

First, you need to obtain the hyperlink for your list’s New Item form. Here are the steps for capturing this URL:

  1. Go to the list you want to create a custom hyperlink for.
  2. Right-click on the Add new item hyperlink that appears at the bottom of the list view page. When the pop-up menu appears, select Copy Shortcut.
  3. Open a new browser window.
  4. Go to the address bar and do a Ctrl+V to paste in your newly copied URL.
  5. Press Enter. You will automatically be redirected to your list’s New Item page.
  6. Copy the updated URL that appears in your address bar–this is the URL you’ll be using to create your custom hyperlink.

Now that you have your New Item form’s URL, you’re ready to customize the URL and add it to your site’s Home.aspx web part page. (Note that the steps outlined below can be used to add custom hyperlinks to any SharePoint web part page. You are not limited to adding these links to your site’s landing page.)

  1. Go to your site’s landing page.
  2. Click on Site Actions > Edit Page.
  3. Click on the Insert subtab.
  4. Click on the More Web Parts icon.
  5. Click on Forms, select the HTML Form Web Part and click on the Add button.
  6. Once the new HTML Form Web Part is added to your page, click on the chevron for the web part and select Edit Web Part.
  7. When the web part pane appears, click on the Source Editor… button.
  8. Delete the text that appears in the text entry box.
  9. Key in the HTML code shown below. Replace the text highlighted in yellow with the URL for your new item form. Replace the text highlighted in purple with the verbiage you want displayed as your link. Leave the text highlighted in pink–this is the magic code that will make your hyperlink return users back to your site’s landing page after they submit their form.
  10. Click Save to save your changes.

That’s it! Your first HTML link is ready to go. Test it out and validate that it is working as desired.

You may want to pretty up your HTML Form Web Part a little bit (e.g. change the name of the web part and add additional form links), but otherwise you are ready for business. Here’s a picture of my finished page:

And here’s a picture of my final Source Editor code:

Note that I added some additional HTML tagging around my links–just enough to create a bulleted list for my form links. You can add in as much (or as little) HTML tagging as you want.

25 comments

  1. Thanks for the post, it was easy to follow. However, I get an HTTP 400 error when I submit a new item with the form. It doesn’t redirect me back to the original page. Any suggestions?

  2. I have a picture library web part on my page, and after I finish submitting it returns me to the picture library, not the page?

  3. Hello are using WordPress for your site platform?

    I’m new to the blog world but I’m trying to get started and set up
    my own. Do you require any coding knowledge to
    make your own blog? Any help would be really appreciated!

  4. I am trying to do this with a workflow initiation form. I want the user to be directed back to a webpart page instead of to the default list. How could I accomplish this?

  5. on the Source editor window, I type in the suggest html code and click save. I’m presented with a tiny window that says “Cannot Save your Changes”

    any ideas on this one?

    1. Using a picture as your clickable link is fairly easy. When you add in your HTML code in the Source Editor, just call an image instead of keying in text to display for your link. You’ll need to use the IMG SRC HTML code for calling an image.

  6. Dear Sarah
    I am new to this and your explanation is fantastic. I also want to add to an image, but I dont know how to access the IMG SRC HTML code, please can you advise

  7. Hi, it´s very usefull, but if I want to redirect to another site, how can i change the code to do this please?

  8. Hello…I followed the steps you noted and it was worked perfectly (thanks a million); however, not sure what happened but now, when the form opens, you click the Submit button, instead of going back to the home page, it just stays there on the form screen. Interesting though, when you click the Cancel button, it takes you back to the home page. Any help would be greatly appreciated.

  9. Great post, thanks. Is there a way to differentiate between the submit and the cancel button? I’d love to have the submit button just present a “your content has been saved” information to the user?

  10. Thoughtful discussion ! my colleagues last month learned about http://goo.gl/eNFpRw to convert pdf ! It’s noticeably easy to get the hang of and it’s useful ! I saw they might have a 7 day promotion now

  11. I tried the steps for SharePoint 2010, but after entering the details in the form when I click on “Save” I am redirected to the Original List and not to the homepage, I have verified the ling and it is exactly similar to what has been outlined. Can you help as to what might be causing this

Leave a reply to Paula King Cancel reply