I'm able to successfully redirect a NewForm.aspx page after saving using the query string parameter Source=.

However, I would like to redirect back to another NewForm.aspx page so the user can add another item (This may be a bad approach from the start).

If I wanted to continue using the query string parameter method, I would need to change the URL the save button is pointing to. I've attempted to use the window.location.replace with no success. My goal is to create a loop of NewForm.aspx redirects so the user can add multiple items. (I want to use all the validation and other business logic that was built into this custom form)

  • What happened when you set Source= to the NewForm URL ? – Danny '365CSI' Engelman Mar 3 '17 at 19:23
  • @Danny'365CSI'Engelman Setting the Source worked exactly as it was supposed to. It would redirect me to the url I specified. – HiTech Mar 3 '17 at 19:34
  • ?? So what is your question then? – Danny '365CSI' Engelman Mar 3 '17 at 19:42
  • @Danny'365CSI'Engelman My first sentence of my question answered your last question... The problem is how do you get it to contiune looping. Hitting save the first time will redirect you, but once you hit save on the next item wont because the paramaeter wasn't set in the save button which I mentioned in my question. – HiTech Mar 3 '17 at 19:46

Create a Redirect-Page (I think a Publishing site default has that type of page)

Otherwise create an empty page with JavaScript code:

document.location="[URL of your NewForm]?Source=" + document.location.href;
  • I'm not sure If I fully understand your fist suggestion. However, I think I might understand yours second. Just to make sure I understand your answer correctly. After I click "Save" in my NewForm.aspx I'm redirected to a "Redirect-Page" that has JS that sets the document.location? – HiTech Mar 6 '17 at 20:31
  • Yes, people click save on page A, source= takes them to B which immediatly reloads to A?source=B again – Danny '365CSI' Engelman Mar 6 '17 at 20:50

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.