SharePoint Jquery Change Save Button Redirect URL New and Edit Form

I came across a situation when client wants to redirect different url after item is saved.

By using Jquery I am able to redirect to a different page after user had save all information from page.

Use below Jquery to change redirect URL of save button

$(document).ready(function() {

//Select Save btnSave
var btnSave = $(“input[id$=SaveItem]”);

//Remove Default Redirect Attribute of Save
btnSave.removeAttr(“onclick”);

btnSave.click(function() {

var elementName = $(this).attr(“name”);

var newPostbackUrl = “http://dell-pc:9999/_layouts/settings.aspx”;

if (!PreSaveItem()) return false;

WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(elementName, “”, true, “”, newPostbackUrl, false, true));
});
});

One thought on “SharePoint Jquery Change Save Button Redirect URL New and Edit Form

  1. It’s really a great and useful piece of info.

    I am satisfied that you simply shared this helpful info with us.

    Please stay us up to date like this. Thank you for sharing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s