[jQuery] Re: Recursive setting of names in jquery

2007-08-28 Thread Sam Collett
The way I would do this is get all inputs with a name beginning with 'total' then use .each: // save jQuery object for later use $totals = $("[EMAIL PROTECTED]"); $totals.each( function() { // get letter var letter = this.name.substr(5); if(letter == "A") this.value = "Total A"; }); On Aug

[jQuery] Re: Recursive setting of names in jquery

2007-08-28 Thread Karl Swedberg
Hi Brett, I'm pretty sure this should work: $("[EMAIL PROTECTED]" + currentLetter + "]") Forgive me if this is what you've already tried. It was hard to tell because you only included part of the selector in your second example. --Karl _ Karl Swedberg www.englishrules.com ww

[jQuery] Re: Recursive setting of names in jquery

2007-08-28 Thread Erik Beeson
This should do what you want: var letter = 'A'; $("[EMAIL PROTECTED]'total" + letter + "']").val(...); --Erik On 8/27/07, Brett <[EMAIL PROTECTED]> wrote: > > Hello there, I've been loving jQuery so far - so efficient, and a > great piece of code to work with. > > I was wondering if it is poss