maybe I haven't explained well (my English is not good) or I'm reading or translating wrong the answers
obviously that I'll never have really an array of controls... but if I get an array when I use getElementsByName() my question was whether to "prototype" implements a short call to do the same... something like $X('myarray') Well, what I was doing and I finished, so we can close this topic. On 24 jul, 07:11, ColinFine <colin.f...@pace.com> wrote: > On Jul 24, 1:02 am, diegoturriaga <diegoturri...@gmail.com> wrote: > > > > > 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... :) > > I'm not sure if you are under a misapprehension. > > The value of a 'NAME' property in HTML is a CDATA - a string of text. > It has no structure. > You are free to call an input "opt[0][]" but that is a text string, > not any kind of an array in any language. > (PHP kindly treats inputs with [] in their names specially, but that > is the server-side program, not anything to do with the page or > javascript: I don't know whether any other server-side languages do > this). > > So if you want to use prototype (or any other javascript) to > manipulate these names, you must treat them as text: match them as > text, perhaps even 'eval' them. But they are not arrays in any way. > > As Matt says, the nearest you can get to this in Prototype is by using > the =~ match in a CSS selector, but that will not necessarily do what > you need. Otherwise you will have to do basic Javascript text > matching, or use the suggestions others have made. > > (It may be that you already understand the point I am making, in which > case, my apologies).- Ocultar texto de la cita - > > - Mostrar texto de la cita - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---