Modify ↓
Ticket #4119 (closed bug: invalid)
jQuery.each() ignors checkbox
| Reported by: | jbeckton | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3.1 |
| Component: | unfiled | Version: | 1.3.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
var fields = jQuery("#checkbox,#text1,#text2");
console.log(fields); //shows all 3 elements
jQuery.each(fields,function(){
console.log(this.name + " = " + this.value); // missing checkbox
})
Change History
comment:2 Changed 4 years ago by jbeckton
Disregard... my stupid mistake.
the sample code I submitted does not show an if statement I was using to evaluate empty fields.
During the jQuery.each iteration I had something like if this.value == "", when it comes to checkboxes that would not be a valid expression.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

What does your markup look like? Do you have an element with an *id* of checkbox ?