Reputation: 765
I'm trying to use Bootstrap Toggle, but I don't know how to check when a user check it on or off in order to send it using ajax.
how can I do that ?
<div class="checkbox">
<label data-label-id="<?= $data->id; ?>" id="message_status">
<input id="check_toogle" type="checkbox" data-toggle="toggle">
</label>
<div class="delete_message">
❌
</div>
</div>
http://www.bootstraptoggle.com/
Upvotes: 1
Views: 6027
Reputation: 16460
I guess
$('#bsfdsf').is(':checked')
is a way to go. This should return true
if checkbox is checked and false
otherwise.
Upvotes: 5