Re: PHP and JavaScript on a form validation task
| From: | Kevin Stone | Date: | Fri, 27 Sep 2002 20:41:12 +0000 |
| Subject: | Re: PHP and JavaScript on a form validation task | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117891@lists.php.net to get a copy of this message | ||
Instead of check for $ready2be_checked, use a hidden form field instead of
relying on the submit button to be pressed. If the Javascript auto-submits
the form the hidden field will still be there.
-Kevin
----- Original Message -----
From: "Riccardo Sepe" <zikiki@tin.it>
To: "php-general" <php-general@lists.php.net>
Sent: Friday, September 27, 2002 2:19 PM
Subject: [PHP] PHP and JavaScript on a form validation task
> Hi every1 I'm buidin' up a form that should perform a couple of checks
> before submit.
> I used javascript but as the form has got option fields also and some
> field changes upon the checkbox chosen
> the script has to know when I'm just changing the option or when I'm
> tryin' 2 send the form...
> (in order to change the option or eventually perform the check).
> Can I do that on the same page? ..I mean can I pass a variable through
> javascript 2 php?
>
> The problem is that if I call the submit button "ready2be_checked" and I
> use an onclick(validate_the_form) handle,
> javascript works fine but it misses the variable "ready2be_checked" so
> the "isset" statement for ex. if(isset($ready2be_checked)){ ....}
> doesn't work!
> Using onsubmit instead,
> javascript performs the check and sends the form anyway cause the isset
> check finds the variable $ready2be_checked !!
> ? ? ? ? ? ? ?
>
> Sorry if I posted it twice
> Thanx in advance
> Ricky
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>