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: 
Danny gave a great answer already, but in case someone is looking to do this within a SharePoint-Hosted App, you can create a custom button within Default.aspx with this code:

```
<asp:HyperLink CssClass="menuLink" runat="server" NavigateUrl="JavaScript:window.location = _spPageContextInfo.webAbsoluteUrl + 
            '/Lists/ListName/NewForm.aspx?Source=' + _spPageContextInfo.webAbsoluteUrl + '';" Text="Add New List Item" />

```

This button will bring the user to the NewForm.aspx and after they save, it will bring them back to Default.aspx in the App / Add-in Web
This worked for me. Give it a try.

```
function PreSaveAction() {
    var URL = location.pathname.replace('NewForm.aspx', 'EditForm.aspx');
    if (GetUrlKeyValue('IsDlg') === '1') {
        URL += "?IsDlg=1";
    }
    $("#aspnetForm").attr('action', location.pathname + "?Source=" + URL);
    return true;
}

```