RE: [PEAR] Client-validation but not on all buttons?

From: Date: Tue, 16 Dec 2003 15:15:41 +0000
Subject: RE: [PEAR] Client-validation but not on all buttons?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-9591@lists.php.net to get a copy of this message
Hi! Well ... Not _I_ check it "onSubmit" - QF does ... I am using standard validation generated by PEAR. You are right - probably "onClick" would be a solution - so my question now is: how can I change the standard behaviour to use "onClick" the easiest way? Regards Daniel > -----Original Message----- > From: Torsten Roehr [mailto:roehr@zilleon.com] > Sent: Tuesday, December 16, 2003 4:05 PM > To: pear-general@lists.php.net > Subject: RE: [PEAR] Client-validation but not on all buttons? > > > Hi Daniel, > > if I understand you right, you check your fields with > JavaScript via onSubmit(), right? Why don't you do it with > onClick() on the Submit button? Then it is only validated if > someone clicks on Submit. It could look like: > > <input type="submit" value="Submit" onClick="validateForm(); > return false;"> > > Of course validateForm() must then contain something like > document.forms[0].submit() > > > By the way, this is not PEAR-related, is it? > > > Regards, > > Torsten > > -----Original Message----- > From: Daniel Kopp [mailto:pear@daniu.de] > Sent: Tuesday, December 16, 2003 3:54 PM > To: pear-general@lists.php.net > Subject: [PEAR] Client-validation but not on all buttons? > > > Hi! > > How can I get JavaScript validation but not for all Buttons. > In php it is easy to get validation wherever (and only where) > necessary but how can I tell my JavaScript to ignore > validation on "Cancel" Buttons If I could overwrite the > onSubmit-Action with JavaScript would be fine for me - but I > guess that is not possible, is it? Or can I add some code to > the JavaScript?

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