[dev] cancel button - how to reset a edited horde form

Sebastian Birnbach birnbacs at gmail.com
Tue Nov 8 18:08:22 UTC 2016


I whish to have a 'cancel' button on a Horde_Form.

I added a button and the PHP page evaluates the name of the submitbutton.
If it is the wrong one (i. e. _("cancel")), the form entries are discarded
an processing stops. However, the page is not updated to the old values,
instead the edited (unprocessed) values still show up.

I was wondering if
* there is something like a reset method for the form (yes, I looked in the
docs, but not all methods are extensively documented)
* I can trigger the 'reset' function for which there is a default button
* I need to keep a copy of the form variables object for reset purposes
or
* there is a different mechanism for supporting a cancel button

It seems like a basic thing so there surely is a recommended way of doing
it.

Kind regards

  Sebastian


More information about the dev mailing list