[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-10-31 Thread kangax
On Oct 31, 12:21 pm, Matt <[EMAIL PROTECTED]> wrote: > This should be an easy one but it's been a long day... > > Let's say I have this structure: > > >   1 >   2 >   3 > > > Basically, I have a function that I only want to run when all three of > the are set to 'on'. Since this is dynamic code

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-10-31 Thread Matt
Thanks kangax, that worked well. One question: since I'm working with dynamically-generated code, is there some way I can concatenate variable names? For instance, this code is working in a function, so I actually want to use an ID number to identify #container. I've tried something like: $$('#c

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-10-31 Thread Gabriel Gilini
I'm thinking $$(eval('#container_'+boxID+' span')); Don't know if it's the right thing to do though. Cheers Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Fri, Oct 31, 2008 at 2:21 PM, Matt <[EMAIL PROTECTED]> wrote: > > Thanks kangax, that worked well. > > One questi

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-10-31 Thread Jarkko Laine
On 31.10.2008, at 21.25, Gabriel Gilini wrote: > I'm thinking $$(eval('#container_'+boxID+' span')); > Don't know if it's the right thing to do though. Why would you want to eval that string? Matt, could you elaborate a bit more? > $$('#container_'+boxID+' span'); actually looks to be fine. W

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-10-31 Thread kangax
On Oct 31, 1:21 pm, Matt <[EMAIL PROTECTED]> wrote: > Thanks kangax, that worked well. > > One question: since I'm working with dynamically-generated code, is > there some way I can concatenate variable names? For instance, this > code is working in a function, so I actually want to use an ID numb

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-10-31 Thread Gabriel Gilini
Indeed, I don't know why I said that lol.I guess I was thinking of var or function name. Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Fri, Oct 31, 2008 at 6:20 PM, Jarkko Laine <[EMAIL PROTECTED]> wrote: > > On 31.10.2008, at 21.25, Gabriel Gilini wrote: > > > I'm th

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-11-01 Thread Matt
On Oct 31, 8:20 pm, Jarkko Laine <[EMAIL PROTECTED]> wrote: > Matt, could you elaborate a bit more? > > > $$('#container_'+boxID+' span'); > > actually looks to be fine. What are you getting with it and what are   > you expecting? > > //jarkko I'm getting the literal string, $$('#container_'+box

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-11-01 Thread kangax
On Nov 1, 11:57 am, Matt <[EMAIL PROTECTED]> wrote: [...] > Kangax: that method won't work for me, it's pulling stuff out of a > database so the id numbers don't increment in any kind of order. Ok. How do you associate those numbers with certain elements then? You can also iterate over an array o

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-11-01 Thread Jarkko Laine
On 1.11.2008, at 17.57, Matt wrote: > > On Oct 31, 8:20 pm, Jarkko Laine <[EMAIL PROTECTED]> wrote: > >> Matt, could you elaborate a bit more? >> >>> $$('#container_'+boxID+' span'); >> >> actually looks to be fine. What are you getting with it and what are >> you expecting? >> >> //jarkko > > I

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-11-03 Thread ColinFine
There is something very confusing about what you have said. In your text you say "I can only pass the ID of the element through a function", in the code you refer to "span_1" etc as the 'spanName', but then it is actually a class name. Is it really an ID, a name, or a class? You only exhibit a sin

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-11-03 Thread Matt
On Nov 1, 4:38 pm, Jarkko Laine <[EMAIL PROTECTED]> wrote: > 1) your alerting with a string "bar" there. > 2) $$ returns an array of elements. If you want a single item, why not   > give the span a unique id and call it with $? If you need to use the   > double-dollar selector, you need to get

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-11-03 Thread Matt
On Nov 3, 11:12 am, ColinFine <[EMAIL PROTECTED]> wrote: > There is something very confusing about what you have said. In your > text you say "I can only pass the ID of the element through a > function", in the code you refer to "span_1" etc as the 'spanName', > but then it is actually a class na

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-11-07 Thread Matt Andrews
Can anyone help? I'm really close to solving this, I just need someone with a better grasp of Javascript to prod me in the right direction... On Nov 3, 9:51 am, Matt <[EMAIL PROTECTED]> wrote: > On Nov 1, 4:38 pm, Jarkko Laine <[EMAIL PROTECTED]> wrote: > > > > > 1) your alerting with a string "b

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-11-07 Thread Alex Mcauley
To: "Prototype & script.aculo.us" Sent: Friday, November 07, 2008 3:41 PM Subject: [Proto-Scripty] Re: testing whether all elements in a div have a certain class Can anyone help? I'm really close to solving this, I just need someone with a better grasp of Javascript to prod me in

[Proto-Scripty] Re: testing whether all elements in a div have a certain class

2008-11-10 Thread Matt Andrews
ng trouble deciphering what you want to achieve > > Alex > > - Original Message - > From: "Matt Andrews" <[EMAIL PROTECTED]> > To: "Prototype & script.aculo.us" > Sent: Friday, November 07, 2008 3:41 PM > Subject: [Proto-Scripty] Re: testin