
July 9th, 2000, 02:22 AM
|
|
Contributing User
|
|
Join Date: Jun 2000
Posts: 114
Time spent in forums: < 1 sec
Reputation Power: 9
|
|
|
I have a control array on a form in HTML. The form submits to a php script. In order to pass the values of the form as elements of an array, the array must have square brackets at the end of the control name. For example:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><input type=text name="text_array[]">
<input type=text name="text_array[]">[/code]
This creates two elements that are correctly passed to a php script, however, now the array is practically useless to the JavaScript. As in:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><script language="JavaScript"><!--
alert(document.form.text_array[0].value)
--></script>[/code]
Just doesn't work the way it did when the control names didn't have the brackets... In fact, it doesn't work at all, and no matter how I try to fool it (blah.text_array[[0]].blah) it just won't work for me...
|