Question: What is the best way to add redirect function into the save button on a newform in SharePoint 2013.

When the user create a list item, he/she should be redirected to another form.
Is it possible to get and parse the new generated item ID?

Start - Newform URL: <http://mysharepoint.com/sites/project/lists/alist/NewForm.aspx>

End - Editform URL: <http://mysharepoint.com/sites/project/lists/alist/EditForm.aspx?ID=88>

Thanks

Answer: 
### Add the URL of the next form as the &Source=[url] parameter

The Source parameter in the URL is where the browser is redirected to after a Form is saved.
Open an EditForm and investigate the URL
The URL has to be URL encoded (and it needs to be within the SharePoint domain)

```
https://xxx.sharepoint.com/sites/VM/Lists/Tasks/NewForm.aspx
?Source=
 https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2FVM%2FLists%2FTasks%2FAllItems%2Easpx
&RootFolder=

```

So if you replace that Source with URL of a NewForm

```
https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2FVM%2FLists%2FTasks%2FNewForm.aspx

```

You can add an item and then be returned to a Blank NewForm

### On that new form you will have to add code to retrieve the last added ID

You can do it with JavaScript code or put a hidden ListView WebPart on the NewForm page that lists the last created item and then use some script to extract what you need and update the fields in the Form

... takes just a bit of scripting
I racked my brain trying to figure out how to both save and redirect to another page and after almost a week of failed attempts I discovered this page on msdn that reveals the different properties of the SharePoint:SaveButton. <https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.savebutton_members.aspx>

After tinkering around for a bit I discovered that by using RedirectURL I could both save and redirect to another page. See code below:

```
<SharePoint:SaveButton  RedirectUrl="http://mysitecollection/Pages/Thank-You.aspx" runat="server" ControlMode="Edit" id="savebutton2"/>

```

I only tested this on SP2013 on premise. It only seemed to work when I used a url that was in my site collection(and only after I used <http://mysitecollection/Pages/Thank-You.aspx> rather than ../../Thank-You.aspx), but that's what I needed it for anyways so it solved my problem. Perhaps there's something else that needs to be done to redirect to an external page, but otherwise this was a breakthrough for me.

Hope that helps others that come across this page.