supposing I have 5 checkboxes that I created manually through HTML, all of which have the attributes; Name, Type and Value. All of those checkboxes, when checked triggers an event which allows a button to be enabled. (Code below)
$('input[type="checkbox"]').click(function() {
var $this = $(this);
if ($this.is(':checked')) {
$("#deleteModalTrigger").prop("disabled",false);
} else {
$("#deleteModalTrigger").prop("disabled",true);
}
});
Now, I create another checkbox through javascript and append it to a row in a table. It appears in the view, but checking it does not trigger the code above even though it is also a checkbox.
var column1 = document.createElement('td');
var cb1 = document.createElement('input');
cb1.type="checkbox";
cb1.name="foo";
cb1.value="Something-cbvalue-0";
column1.setAttribute("rowspan","2");
column1.appendChild(cb1);
row.appendChild(column1);
Any help is appreciated! Thank you.