Re: associative arrays in html forms and javascript
| From: | Colin Viebrock | Date: | Wed, 08 Aug 2001 15:13:33 +0000 |
| Subject: | Re: associative arrays in html forms and javascript | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61843@lists.php.net to get a copy of this message | ||
> <html>
> <body onload="document.formname.arraystuff[inputfield].focus()">
> <form name="formname">
> <input type="text" name="arraystuff[inputfield]">
> </form>
> </body>
> </html>
>
> and like that the text field won't focus and the parser tells me that
> arraystuff has no properties and that inputfield is undefined.
<body
onload="document.formname.elements['arraystuff[inputfield]'].focus()">
... should work.
- Colin