Re: Question: arrays and form elements
| From: | Brent Baisley | Date: | Thu, 30 Dec 2004 16:38:56 +0000 |
| Subject: | Re: Question: arrays and form elements | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-205373@lists.php.net to get a copy of this message | ||
Nope. Is there a problem you are having with using that syntax?
If you are having trouble with referencing the fields with javascript, you can't use the "regular" syntax you are used to.:
document.formname.fieldname[]
That will give you an error because of the brackets.
In javascript you'll need to reference field names with brackets like this:
document.formname.elements["fieldname[]"]
On Dec 30, 2004, at 6:48 AM, Stuart Felenstein wrote:
Generally, when I set up a form where, for example, I'll be taking multiple selections from a list I would set the variable / element name as "myvar[]". So I have the brackets [] after the variable name to make it an array. What I want to know is there a way to get around the use of this syntax ? If the variable name was just "myvar" (no brackets) is there a way for me to still grab all the selections and put them into an array ? Hope this question is clear. Thank you Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577