Well... first that all thanks for your reply!

I'm trying to use a multidemensional javascript array... various
arrays of input controls of type checkbox

I have 10 controls with name "myarray[1][]"
other 10 controls with name "myarray[2][]"
other 10 controls with name "myarray[3][]"
...
other 10 controls with name "myarray[n][]"

And I need get al controls named iqual in an array var... something
like:

var aux = document.getElemntsByName('myarray[1][]`);

but using prototype sintax... :)


On Jul 23, 7:04 pm, Matt Foster <mattfoste...@gmail.com> wrote:
> Hey Diego,
>
>       I'd suggest learning CSS, in particular CSS Selectors.  Second
> read up on prototype, you were a dollar sign away from almost having
> it.
>
> In your case, the name is too inconsistent, you could have almost
> gotten away with $$("input[name~=opt") but alas there is no space
> after it so it fails.
>
> As an alternative, looking at your code you just do... $$("input
> [type=text]") or if your collection requisites are more specific, add
> a class to the elements you want to collect and then simply $
> (".myClass")
>
> --
>
> http://positionabsolute.net
>
> On Jul 23, 5:50 pm, diegoturriaga <diegoturri...@gmail.com> wrote:
>
>
>
> > I have something like that:
>
> > <tr>
> >   <td>PEPE</td>
> >   <td><input ... name="opt[0][]"><input ... name="opt[0][]"> ...
> > <input ... name="opt[0][]"></td>
> >   <td><select ... name="selA[]">...</select></td>
> >   <td><select ... name="selB[]">...</select></td>
> > </tr>
> > <tr>
> >   <td>JUAN</td>
> >   <td><input ... name="opt[1][]"><input ... name="opt[1]
> > []">...<input ... name="opt[1][]"></td>
> >   <td><select ... name="selA[]">...</select></td>
> >   <td><select ... name="selB[]">...</select></td>
> > </tr>
> > ...
> > <tr>
> >   <td>TITO</td>
> >   <td><input ... name="opt[n-1][]"><input ... name="opt[n-1][]"> ...
> > <input ... name="opt[n-1][]"></td>
> >   <td><select ... name="selA[]">...</select></td>
> >   <td><select ... name="selB[]">...</select></td>
> > </tr>
>
> > I want to get the array opt[x] using prototype but $('opt[x]') give me
> > only the first instance.
>
> > I need something like getElementsByName but using prototype :)
>
> > Sorry for my english...- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to