Re: [jQuery] checkbox items with same name

2006-09-06 Thread Shawn Tumey
On 9/6/06, Stephen Howard <[EMAIL PROTECTED]> wrote:
Shawn's solution below won't work for you because it is searching on idsrather than names, which is what you have.DOH. My bad. Setphen is correct, my solution won't work. I almost never use the name attribute any more, I always use id.
I need to read more carefully.-- Shawn TumeyCofounderMT Web Productions LLC
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] checkbox items with same name

2006-09-06 Thread Stephen Howard
I think that this might work, though I haven't tried combining attribute 
tests and pseudo classes before:

$('[EMAIL PROTECTED]:checked')

Shawn's solution below won't work for you because it is searching on ids 
rather than names, which is what you have.

Shawn Tumey wrote:
> On 9/6/06, *Aljosa Mohorovic* <[EMAIL PROTECTED] 
> > wrote:
>
> i have 5 checkbox items with same name:
>
> 
> 
> 
> 
> 
>
> and option to select multiple elements with same name must work.
>
> $('#form_name').find("[EMAIL PROTECTED]@checked]") gives me only
> one element.
> how can i use checkbox elements like select tag?
>
> Aljosa Mohorovic
>
>
> Get all element with the geographic id by doing:
>
> $('#geographic')
>
> Then you can reference the DOM object as an array like:
>
> alert($('#geographic')[4].value));
>
> This should alert 5 which is the value of the fifth element in base 0 
> indexed array.
>
> If you want to do something on all of the checkboxes with jQuery use:
>
> $('#geographic').each(function {
> 
>})
>
> Hope this helps. :)
>
> -- 
> Shawn Tumey
> Cofounder
> MT Web Productions LLC
> 
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>   

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] checkbox items with same name

2006-09-06 Thread Shawn Tumey
On 9/6/06, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote:
i have 5 checkbox items with same name:

and option to select multiple elements with same name must work.$('#form_name').find("[EMAIL PROTECTED]@checked]") gives me onlyone element.how can i use checkbox elements like select tag?
Aljosa MohorovicGet all element with the geographic id by doing:$('#geographic')Then you can reference the DOM object as an array like:alert($('#geographic')[4].value));
This should alert 5 which is the value of the fifth element in base 0 indexed array.If you want to do something on all of the checkboxes with jQuery use:$('#geographic').each(function {    
   })Hope this helps. :)-- Shawn TumeyCofounderMT Web Productions LLC
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] checkbox items with same name

2006-09-06 Thread Aljosa Mohorovic
i have 5 checkbox items with same name:







and option to select multiple elements with same name must work.

$('#form_name').find("[EMAIL PROTECTED]@checked]") gives me only
one element.
how can i use checkbox elements like select tag?

Aljosa Mohorovic

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/