Hello, I have a form where the values are pulled from MySQL and looped through using PHP. The name and id values are create dynamically.
For example HTML: Item A <input type="checkbox" name="event_id_22" id="eid_22" / > Item B <input type="checkbox" name="event_id_23" id="eid_23" / > For example PHP: Item A <input type="checkbox" name="event_id_$value" id="eid_$value" / > Item B <input type="checkbox" name="event_id_$value" id="eid_$value" / > I'm using jQuery to count the boxes that get checked. How can I get jQuery to see my PHP variable so it can count the number of boxes that get checked? Thoughts? $(document).ready(function() { $("#eid_??").click(function() { if (this.checked == true) { var event_id = $("#eid_??").length; $("#eventItems").text(event_id); } if (this.checked == false) { $("#eventItems").empty(); } }); });