Hi ,
I have a custom list . I have few controls which are mandatory and on clicking on save, I want to save the data in custom list, but redirect the page to a custom page.
I have tried the below in Newform.aspx. The page is getting re-directed , but the data is not saved and I get an error message as - You must specify a value for the required field. But I have filled all the fields.
var button = $("input[id$=SaveItem]");
button.removeAttr("onclick");
button.click(function() {
var elementName = $(this).attr("name");
var aspForm = $("form[name=aspnetForm]");
var newPostbackUrl = "/s/customsite/SitePages/Thank-you.aspx";
if (!PreSaveItem()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(elementName, "", true, "", newPostbackUrl, false, true));
}); How to fix this?
Thanks