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.

Pre-Save:
This example shows how to show an alert and wait for OK or Cancel action.

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

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