{"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>
\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

Pre-Save:
\n<\/strong>This example shows how to show an alert and wait for OK or Cancel action.<\/p>\n

function 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

Post-Save:<\/strong>
\nThis example shows how to return to home page after user\u00a0creates the item.<\/p>\n

function PostSaveAction() {\r\n    window.location.replace = \"https:\/\/\/sites\/Site\/SitePages\/Home.aspx\";\r\n    return true;\r\n}<\/pre>\n

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":"\nSharePoint New Item Form Actions : Binary Bits<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SharePoint New Item Form Actions : Binary Bits\" \/>\n<meta property=\"og:description\" content=\"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() { […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/\" \/>\n<meta property=\"og:site_name\" content=\"Binary Bits\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-23T10:11:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-06-23T10:15:28+00:00\" \/>\n<meta name=\"author\" content=\"Kannan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Kannan_B\" \/>\n<meta name=\"twitter:site\" content=\"@Kannan_B\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kannan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/\"},\"author\":{\"name\":\"Kannan\",\"@id\":\"https:\/\/blog.binarybits.net\/#\/schema\/person\/dda0e26212583a95f286cf67604fd855\"},\"headline\":\"SharePoint New Item Form Actions\",\"datePublished\":\"2017-06-23T10:11:58+00:00\",\"dateModified\":\"2017-06-23T10:15:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/\"},\"wordCount\":80,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blog.binarybits.net\/#\/schema\/person\/dda0e26212583a95f286cf67604fd855\"},\"keywords\":[\"Actions\",\"New Form\",\"SharePoint\"],\"articleSection\":[\"SharePoint\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/\",\"url\":\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/\",\"name\":\"SharePoint New Item Form Actions : Binary Bits\",\"isPartOf\":{\"@id\":\"https:\/\/blog.binarybits.net\/#website\"},\"datePublished\":\"2017-06-23T10:11:58+00:00\",\"dateModified\":\"2017-06-23T10:15:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.binarybits.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SharePoint New Item Form Actions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.binarybits.net\/#website\",\"url\":\"https:\/\/blog.binarybits.net\/\",\"name\":\"Binary Bits\",\"description\":\"Bits & Pieces - A blog by Kannan Balasubramanian\",\"publisher\":{\"@id\":\"https:\/\/blog.binarybits.net\/#\/schema\/person\/dda0e26212583a95f286cf67604fd855\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.binarybits.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/blog.binarybits.net\/#\/schema\/person\/dda0e26212583a95f286cf67604fd855\",\"name\":\"Kannan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/blog.binarybits.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/blog.binarybits.net\/wp-content\/uploads\/2017\/04\/12976869_10207528235497646_1307827709790943986_o.jpg\",\"contentUrl\":\"https:\/\/blog.binarybits.net\/wp-content\/uploads\/2017\/04\/12976869_10207528235497646_1307827709790943986_o.jpg\",\"width\":1270,\"height\":1270,\"caption\":\"Kannan\"},\"logo\":{\"@id\":\"https:\/\/blog.binarybits.net\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SharePoint New Item Form Actions : Binary Bits","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/","og_locale":"en_GB","og_type":"article","og_title":"SharePoint New Item Form Actions : Binary Bits","og_description":"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() { […]","og_url":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/","og_site_name":"Binary Bits","article_published_time":"2017-06-23T10:11:58+00:00","article_modified_time":"2017-06-23T10:15:28+00:00","author":"Kannan","twitter_card":"summary_large_image","twitter_creator":"@Kannan_B","twitter_site":"@Kannan_B","twitter_misc":{"Written by":"Kannan","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/#article","isPartOf":{"@id":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/"},"author":{"name":"Kannan","@id":"https:\/\/blog.binarybits.net\/#\/schema\/person\/dda0e26212583a95f286cf67604fd855"},"headline":"SharePoint New Item Form Actions","datePublished":"2017-06-23T10:11:58+00:00","dateModified":"2017-06-23T10:15:28+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/"},"wordCount":80,"commentCount":0,"publisher":{"@id":"https:\/\/blog.binarybits.net\/#\/schema\/person\/dda0e26212583a95f286cf67604fd855"},"keywords":["Actions","New Form","SharePoint"],"articleSection":["SharePoint"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/","url":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/","name":"SharePoint New Item Form Actions : Binary Bits","isPartOf":{"@id":"https:\/\/blog.binarybits.net\/#website"},"datePublished":"2017-06-23T10:11:58+00:00","dateModified":"2017-06-23T10:15:28+00:00","breadcrumb":{"@id":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.binarybits.net\/sharepoint-new-item-form-actions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.binarybits.net\/"},{"@type":"ListItem","position":2,"name":"SharePoint New Item Form Actions"}]},{"@type":"WebSite","@id":"https:\/\/blog.binarybits.net\/#website","url":"https:\/\/blog.binarybits.net\/","name":"Binary Bits","description":"Bits & Pieces - A blog by Kannan Balasubramanian","publisher":{"@id":"https:\/\/blog.binarybits.net\/#\/schema\/person\/dda0e26212583a95f286cf67604fd855"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.binarybits.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.binarybits.net\/#\/schema\/person\/dda0e26212583a95f286cf67604fd855","name":"Kannan","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/blog.binarybits.net\/#\/schema\/person\/image\/","url":"https:\/\/blog.binarybits.net\/wp-content\/uploads\/2017\/04\/12976869_10207528235497646_1307827709790943986_o.jpg","contentUrl":"https:\/\/blog.binarybits.net\/wp-content\/uploads\/2017\/04\/12976869_10207528235497646_1307827709790943986_o.jpg","width":1270,"height":1270,"caption":"Kannan"},"logo":{"@id":"https:\/\/blog.binarybits.net\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/posts\/901"}],"collection":[{"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/comments?post=901"}],"version-history":[{"count":3,"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/posts\/901\/revisions"}],"predecessor-version":[{"id":904,"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/posts\/901\/revisions\/904"}],"wp:attachment":[{"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/media?parent=901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/categories?post=901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.binarybits.net\/wp-json\/wp\/v2\/tags?post=901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}