RE: [PEAR] Quickform 'cancel' submit button

From: Date: Wed, 18 Jun 2003 10:12:09 +0000
Subject: RE: [PEAR] Quickform 'cancel' submit button
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6082@lists.php.net to get a copy of this message
> -----Original Message----- > From: Jeroen Houben [mailto:jeroen@terena.nl] > > Alexey Borzov wrote: > > > Hi! > > > > Mike Carter wrote: > > > >> However 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. > > Can't you just use something like: > > > $form->addElement('button','cancel','Cancel',array("onClick"=> "location.href='http://www.yahoo.com/'")); The onclick for the image button only gets executed after the onsubmit validation it seems :-( - Mike C. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.489 / Virus Database: 288 - Release Date: 6/10/2003 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________

« previous php.pear.general (#6082) next »