Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a link on an HTML page that opens an Editform.aspx with a particular listitem ID, in a new window. After making changes, I click 'OK'. How can I close the editform.aspx (by default, this returns you to the list which is not what I need, it should close), return to the opening page showing the new edits (refresh). This should be done only with javascript.

share|improve this question
add comment

1 Answer

All you need to do is pass the Source parameter on the Query String. When the EditForm closes, it will always redirect to the page indicated in that parameter. For example:

http://mysite/Lists/EditForm.aspx?ID=1&Source=http://mysite/default.aspx
share|improve this answer
    
Thanks @Marc, for the quick answer. –  Arun Nov 1 '11 at 17:44
    
Marc .. that did not work. It shows the newform.aspx. If you hit 'ok' it gives you an asp.net error page. if you hit 'cancel' it goes back to the documents list. My source page has a .html extension. Can the 'source=' go back to the html page? –  Arun Nov 2 '11 at 16:22
    
Abny particular reason why you are using the HTML extension? Can you switch it to aspx? –  Marc D Anderson Nov 3 '11 at 20:34
    
Your original suggestion worked. I had to use an '&' instead of '?' before the work 'Source'. To answer your most recent question. I was displaying task items on a web page using SPServices. I had put a link to take the user to the edit page, hence wanted the user to return to the web page once they were done..thanks for your grea help. –  Arun Nov 21 '11 at 18:58
    
Sorry about the typo. Fixed above. –  Marc D Anderson Nov 23 '11 at 23:28
add comment

Your Answer

 
discard

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.