you can have access to everything, using the following construct:

window.document.forms[i].elements[j].name and
window.document.forms[i].elements[j].value

so, for example :

<html><body><form>
<input type="text" name="aaa[1]">
<input type="text" name="aaa[2]">
</form></body></html>

the first input text can be accessed as
window.document.forms[0].element[1] while the second can be accessed as
window.doucment.forms[0].elements[2]

-Stathis.



elias wrote:
> 
> How can i access names with '[]' w/o eval() or seeking in form's element?
> 
> -elias
> 
> "Rouvas Stathis" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Actually, you *can* use brackets ([]) in names and javascript can handle
> > them just fine.
> > -Stathis.
> >
> > Max Vysotskiy wrote:
> > >
> > > Hi.
> > > Why doesn't PHP convert mutiselect values with plain names (not
> array-like)
> > > to arrays. Is there any reason to not doing this?
> > >
> > > Example:
> > > I have a page with multiselect, which name is SEL1
> > > (I cannot use square brackets because I need to use a JavaScript on the
> > > page, so, it's not allowed in variable names to contain [ ]  ). When
> browser
> > > submits this page, and if there are sew values selected in this
> multiselect,
> > > it just sends this values along to each other with same name.
> > > (such as in case of GET method:
> http://somehost.com/index.php?SEL1=1&SEL2=2)
> > > So, why not parse this, and in case if there are more than one variable
> with
> > > same name, convert this variable to array, and put all the values there?
> > > Thanx
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to