Re: cancel button - how to reset a edited horde form
Jan Schneider <[email protected]> Thu, 10 Nov 2016 13:46:54 +0000
| Newsgroups | gmane.comp.horde.devel |
|---|---|
| Message-ID | <[email protected]> |
Zitat von Sebastian Birnbach <[email protected]>: > 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 Horde_Form#setButtons() has a $reset parameter for that purpose. -- Jan Schneider The Horde Project http://www.horde.org/ -- dev mailing list Frequently Asked Questions: http://wiki.horde.org/FAQ To unsubscribe, mail: [email protected]