Question

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.

Was it helpful?

Solution

Robert...

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

OTHER TIPS

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:

{ddwrt:GenFireServerEvent('__commit;__redirect={default.aspx}')}

In your case I guess you need write:

{ddwrt:GenFireServerEvent('__commit;__redirect{/newItemAdded.aspx}')}"

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"

try to insert after word *__redirect* symbol =.

__redirect={../../site/newItemAdded.aspx}

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

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top