Bug Tracker

Ticket #4119 (closed bug: invalid)

Opened 6 years ago

Last modified 2 years ago

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:1 Changed 6 years ago by dmethvin

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

comment:2 Changed 6 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.

comment:3 Changed 6 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid
Note: See TracTickets for help on using tickets.