Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

redirect NewForm.aspx after Save Button Click doesn't save certion fields

$
0
0

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));


Thanks and Regards

Er.Pradipta Nayak
Visit my Blog
Xchanging


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>