I'm trying to make multiple select with checkbox ... if I click checkbox A then checkbox B follow click too. But only the A checkbox that appears, the B checkbox I created in a hidden state with css ..
<button type="button" id="delete" title="Delete">Delete</button>
<input type="checkbox" class="select_data" id="A" name="A[]" value="A" />
<input type="checkbox" id="B" name="B[]" value="B">
$('#delete').click(function() {
if($('#A').is(":checked")) {
$('#B').attr('checked', true).val();
}
var data = $(".select_data:checked, .info_del:checked").serialize();
console.log(data);
});
Aucun commentaire:
Enregistrer un commentaire