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.


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:

  • 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
  • Is there a way to keep this looping? Redirect the user back to another NewForm.aspx after creating a new one? Effectively creating a loop? – HiTech Mar 3 '17 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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