Rafael,
>I'm trying exactly the same.
>$("input:checkbox:checked"); returns a set of jQuery elements
>$("input:checkbox:checked").val(); returns the value of the first element
>in
>the set.
>
>I really wanted to get an array with all the values, or even a string,
>without the need to iterate over
> I'm trying exactly the same.
> $("input:checkbox:checked"); returns a set of jQuery elements
> $("input:checkbox:checked").val(); returns the value of the first element in
> the set.
>
> I really wanted to get an array with all the values, or even a string,
> without the need to iterate ov
Gonna have to iterate.
jquery selector gives you a jquery object.
$("input:checkbox:checked").each() is your friend.
On Mar 7, 3:27 pm, Rafael Soares <[EMAIL PROTECTED]> wrote:
> I'm trying exactly the same.
> $("input:checkbox:checked"); returns a set of jQuery elements
> $("input:checkbox:check
I'm trying exactly the same.
$("input:checkbox:checked"); returns a set of jQuery elements
$("input:checkbox:checked").val(); returns the value of the first element in
the set.
I really wanted to get an array with all the values, or even a string,
without the need to iterate over each of the ele
Updating jQuery to 1.2 gives you all the values, as you can see here:
http://docs.jquery.com/Attributes/val
else you can use a plugin
http://www.malsup.com/jquery/form/#fields
pay attention for the result, it might be an array. i haven't checked
that yet.
Good luck
Duncan ha scritto:
> All,
>
>
Or you can use $('#elem').is(':checked')
2008/1/11, James Dempster <[EMAIL PROTECTED]>:
>
>
> $().ready(function() {
> $('#editOptions').click(function() {
> alert($('input:checkbox[name=listProductID]:checked')); //
> returns only the first value, selected or not
> });
$().ready(function() {
$('#editOptions').click(function() {
alert($('input:checkbox[name=listProductID]:checked')); //
returns only the first value, selected or not
});
});
untested but should work.
Also see,
http://docs.jquery.com/Selectors/checkbox
http://docs.jquer
7 matches
Mail list logo