Re: forms checking
| From: | Matt McClanahan | Date: | Wed, 19 Jul 2000 16:24:34 +0000 |
| Subject: | Re: forms checking | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7303@lists.php.net to get a copy of this message | ||
On Wed, 19 Jul 2000, Erb, Maria wrote:
> is there a way with PHP to check fields in a form to make sure they aren't
> blank before submitting the form? Can you call a function to execute when a
> form is submitted like you can with JavaScript? Or are there event handlers
> like OnClick or OnBlur? Or even, can you use JavaScript functions with PHP?
No, PHP is a server-side language. That is, you can't interact with PHP
unless you're interacting with the web server. In the case of a form,
that only happens when the form is being submitted.
What you can do is have the page you're submitting to handle the
verification there. You can also have the script that builds the form
build in JavaScript verification. But the JavaScript verification
won't have access to PHP to do its verification.
Matt