Re: Quickform 'cancel' submit button
| From: | Jeroen Houben | Date: | Wed, 18 Jun 2003 12:23:39 +0000 |
| Subject: | Re: Quickform 'cancel' submit button | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6085@lists.php.net to get a copy of this message | ||
Mike Carter wrote:
Jeroen-----Original Message----- From: Alexey Borzov [mailto:borz_off@cs.msu.su] Hi! Mike Carter wrote:I got around the problem by making one of my action buttons just that - a simple button element and combining this with the javascript mentioned in the email from Jeroen. $actions[] = &HTML_QuickForm::createElement('button', 'action', 'Cancel', array("onClick" => "location.href='index.php'")); For the purists out there, I think "officially" you should use window.location.href, some browsers may complain otherwise, but I'm not 100% sure..However I am unable to cance lthe form because the javascript validation gets executed first. How can I allow for acancel actionbutton 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.