faqts : Computers : Programming : Languages : PHP : kms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

11 of 18 people (61%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How to get working an html tag name array (name="test[]") in javascript.

May 29th, 2002 07:44
Jonathan Dickmann, atu, http://www.geocrawler.com/archives/3/1/1999/8/0/2592205/ http://www.php.net/manual/en/faq.html.php


According to the PHP manual, section 51.4:
Note that if you are using JavaScript the [] on the element name might cause you problems when you try to refer to the element by name. Use it's numerical form element id instead, or enclose the variable name in single quotes and use that as the index to the elements array, for example:
variable = documents.forms[0].elements['var[]'];