Re: Question: arrays and form elements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux