Re: Quickform vaildation rules

From: Date: Wed, 06 Aug 2003 14:12:46 +0000
Subject: Re: Quickform vaildation rules
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-7054@lists.php.net to get a copy of this message
<keith@midnighthax.com> wrote : > I have a Quickform with a validation rule stating that a textarea is > "required". That works well. I have three buttons on the form, "Clear", > "Submit" and "Cancel". The first is the standard reset button; the > latter two are submit buttons. > > The problem I have: if the "Cancel" button is clicked with the textarea > empty, I get the expected validation error. I really want a rule that > says "(textarea required) OR (btn='Cancel')". > > Is there a way of achieving this? Use an attribute like array('onclick' => "javascript:location.href='liste.php';") on your cancel button. BTW, use a button, not a submit. Bertrand Mansion Mamasam

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