Redirect SharePoint NewForm.aspx to "Thank you" page once user saved record.

Requirement : Redirect NewForm.aspx to "Thank you" page once user saved record.

Add ThankYou.aspx at same location where NewForm.aspx is exist (I used SP2010 designer)

Add below JavaScript in content editor web-part

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

Comments

Popular posts from this blog

Dataverse D365 REST Web Api using client secret From Postman or Power Automate desktop (PAD) .

Chrome Extension to auto refresh Power BI report.

How to call SharePoint online rest APIs using postman?