Re: Quickform 'cancel' submit button
| From: | Jeroen Houben | Date: | Tue, 17 Jun 2003 16:16:58 +0000 |
| Subject: | Re: Quickform 'cancel' submit button | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6057@lists.php.net to get a copy of this message | ||
Alexey Borzov wrote:
Hi! Mike Carter wrote:Can't you just use something like: $form->addElement('button','cancel','Cancel',array("onClick"=>"location.href='http://www.yahoo.com/'")); JeroenHowever I am unable to cance lthe form because the javascript validation gets executed first. How can I allow for a cancel action button on a quickform?I think that's more a JavaScript question than a QuickForm one. I am not a JS guru, but I think there is a possibility to set/remove event handlers in JS code. So you'll have to add an onClick handler to your Cancel button that will remove an onSubmit handler from form.