Checkbox checked ajax ne fonctionne pas
Bonjour a tous,
Je voudrais remplir un tableau avec des checkbox stylisés via le plugin iPhoneStyle et lui faire changer l'état du champ en bdd au changement de l'état.
Le bouton semble fonctionner mais rien n'est transmis au final.
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| $(document).ready( function ()
{
$("input[type='checkbox']").iphoneStyle({
checkedLabel: 'YES',
uncheckedLabel: 'NO',
background: '#F9F3E8',
onChange: function($input){
// Function here
$.ajax({
type: "POST",
url: "editables/CRUD.php",
data: "action=update&id=" + $input.closest('tr').attr("id") + "&value="+$input.is(':checked') + "&columnName=" + $input.attr("name")
});
}
});
} ); |
Help.