Actions Archives : Binary Bits https://blog.binarybits.net/tag/actions/ Bits & Pieces - A blog by Kannan Balasubramanian Fri, 23 Jun 2017 10:15:28 +0000 en-GB hourly 1 https://wordpress.org/?v=6.5.2 SharePoint New Item Form Actions https://blog.binarybits.net/sharepoint-new-item-form-actions/ https://blog.binarybits.net/sharepoint-new-item-form-actions/#respond Fri, 23 Jun 2017 10:11:58 +0000 https://blog.binarybits.net/?p=901 The following post describes 3 of the many new Form 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() { […]

The post SharePoint New Item Form Actions appeared first on Binary Bits.

]]>
The following post describes 3 of the many new Form 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() {
    if (confirm("Proceed with saving the item?"))
        return true;
    else
        return false;
}

Post-Save:
This example shows how to return to home page after user creates the item.

function PostSaveAction() {
    window.location.replace = "https:///sites/Site/SitePages/Home.aspx";
    return true;
}

Do make a note that above code requires the Jquery is referenced in the page.

The post SharePoint New Item Form Actions appeared first on Binary Bits.

]]>
https://blog.binarybits.net/sharepoint-new-item-form-actions/feed/ 0