0

Using javascript, how can I get the array of values selected in checkboxes used within a smarty html_options. Ive tried $('#selectbox').val() which returns null.

1 Answers1

0
$("#trigger").click(function () {
    var selected = $("input:checked");
    var values = [];
    selected.each(function (i,d) {
        values.push(d.value);
    });
    console.log(values);

});

http://jsfiddle.net/698Ec/ this is a demo

qiu-deqing
  • 1,323
  • 7
  • 13