Hi i want to redirect from Newform after clicking save button. though i am able to redirect but certain fields i have updated in page load ( with some condition) as not saved. for example if i change the Title to 'myval' and click save button the value in Title will 'notitle' instead 'myval'.
$("[id^='Title_']").val('myval');
var button = $("input[id$=SaveItem]");
button.removeAttr("onclick");
button.click(function() {
var elementName = $(this).attr("name");
var aspForm = $("form[name=aspnetForm]");
oldPostbackUrl = window.location.href;
//aspForm[0].action;
var currentSourceValue = GetUrlKeyValue("Source", true, oldPostbackUrl);
var newPostbackUrl = oldPostbackUrl.replace(currentSourceValue, "https://xyz/Lists/list1/NewForm.aspx?ID=0");
if (!PreSaveItem()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(elementName,'', true, '', newPostbackUrl, false, true));