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 <[email protected]> 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...
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---