SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is in Sharepoint 2007 -- Designer

I have written a Form Action button and it has the following Code:

<input type="button" value="Add List Item" name="BtnSave" onlick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect{../../site/newItemAdded.aspx}')}" />

I've seen this solution a couple times on the web but doing this does not redirect the user at all. It does hit the __commit portion and saves the new list item, but it just posts itself back to the main form and does not redirect.

Any guidance would be great on how to get it to redirect correctly. I have written the above button by hand and by using the Form Action Button in Designer, neither with successful results.

share|improve this question
up vote 3 down vote accepted


This time, dont use relative URLs, just add absolute URL (the entrie path of the page) eg.

<input type="button" value="Add List Item" name="BtnSave" onlick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect{http://<server>/sites/<site name>/Pages/<page name>.aspx}')}" />

It should work, cheers

share|improve this answer
This ended up working. A co-worker came up with the idea to use some xsl as well to grab the beginning of the URL (in a server variable) and use that beginning substring in order to put in what I wanted. Thanks! – Robert Nov 14 '11 at 12:34

I don't know if you resolved the problem. But I had the same problem and I resolved only by putting the page that I want to go to like this:


In your case I guess you need write:


That is because sharepoint take the URL's root. And add automatically this: "../../site/". In your case you are adding twice for example: "../../site/../../site/newItemAdded.aspx"

share|improve this answer

try to insert after word *__redirect* symbol =.


In my case without this "=" code does not work

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.