Dec 7, 2011

////

jQuery: concat checkbox checked values

This is just for my future reference.
/*concat checkbox:checked' values*/
    $(".yourclass").click(function(){
        var allVals =  [];
        $("input[name='yourcheckboxname[]']:checked").each(function(){
            allVals.push($(this).val());
        });
        $("input[name='
yourcheckboxname']").val(allVals);
    })

0 Reactions to this post

Add Comment