Script Question
| From: | PHP List | Date: | Thu, 21 Nov 2002 20:25:52 +0000 |
| Subject: | Script Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-125489@lists.php.net to get a copy of this message | ||
Hi,
This is more of a Javascript question so please forgive.
I generate a dynamic form with php.
I need to be able to test in javascript if a certain field exists:
.
.
if (document.myform.mytextfield) {
.
.
This line will give me the javascript error "document.myform.mytextfield is undefined"
If it does exist, then it works fine.
So how do I test if a field exists without getting an error?
Thanks for any help.