How to put Cancel Button on Form

peterswa62 23 Oct, 2012
I want to put a Cancel Button on a Form, whereby a user has the option to abandon any editing they have made on a form and re-direct to another page without saving to the database. Trouble is how do you bypass the DB Save action which automatically saves the form to the database wether the Submit or Cancel button is pressed? The only way I can think of doing it is to use Custom Code instead of the DB Save Action control detect which button has been pressed and then process the submit action in 2 different ways.
GreyHead 23 Oct, 2012
Hi peterswa62,

You can just make the Cancel button an image with a link to the other page. Then the form won't submit at all and so the data won't be saved.

Bob
peterswa62 24 Oct, 2012
Thanks Bob. Is another way of doing to use Showstopper? How do you use this action? Could you use it to detect if the Cancel Button has been pressed and then not to go on to DB Save?
GreyHead 24 Oct, 2012
Hi peterswa62,

You can use a Submit button with the label cancel and then do some conditional processing. You could use my Event Switcher [GH] action to switch between different action paths and include a Show Stopper or User ReDirect action in one of them; or you could use Custom PHP to redirect the user before you get to the DB Save.

Please see this FAQ

Bob
This topic is locked and no more replies can be posted.