{"id":901,"date":"2017-06-23T15:41:58","date_gmt":"2017-06-23T10:11:58","guid":{"rendered":"https:\/\/blog.binarybits.net\/?p=901"},"modified":"2017-06-23T15:45:28","modified_gmt":"2017-06-23T10:15:28","slug":"sharepoint-new-item-form-actions","status":"publish","type":"post","link":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/","title":{"rendered":"SharePoint New Item Form Actions"},"content":{"rendered":"
The following post describes 3 of the many new\u00a0Form Actions available in SharePoint.<\/p>\n
Cancel<\/b>:<\/strong> Pre-Save: Post-Save:<\/strong> Do make a note that above code requires the Jquery is referenced in the page.<\/p>\n","protected":false},"excerpt":{"rendered":" The following post describes 3 of the many new\u00a0Form Actions available in SharePoint. Cancel: This example shows how to return to home page after user cancels creating the item. $(document).ready(function() { $(‘input[value=Cancel]’).click(function() { window.location.replace(“https:\/\/<siteurl>\/sites\/Site\/SitePages\/Home.aspx”); }); }); Pre-Save: This example shows how to show an alert and wait for OK or Cancel action. function PreSaveAction() { […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[62],"tags":[262,261,208],"yoast_head":"\n
\nThis example shows how to return to home page after user cancels creating the item.<\/p>\n$(document).ready(function() {\r\n $('input[value=Cancel]').click(function() {\r\n window.location.replace(\"https:\/\/<siteurl>\/sites\/Site\/SitePages\/Home.aspx\");\r\n });\r\n});<\/pre>\n
\n<\/strong>This example shows how to show an alert and wait for OK or Cancel action.<\/p>\nfunction PreSaveAction() {\r\n if (confirm(\"Proceed with saving the item?\"))\r\n return true;\r\n else\r\n return false;\r\n}\r\n<\/pre>\n
\nThis example shows how to return to home page after user\u00a0creates the item.<\/p>\nfunction PostSaveAction() {\r\n window.location.replace = \"https:\/\/\/sites\/Site\/SitePages\/Home.aspx\";\r\n return true;\r\n}<\/pre>\n