RE: [PEAR] Client-validation but not on all buttons?
| From: | Torsten Roehr | Date: | Tue, 16 Dec 2003 15:05:27 +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-9584@lists.php.net to get a copy of this message | ||
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?
Regards
Daniel
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php