Ray's js code for status in form

This commit is contained in:
chris 2013-09-11 19:24:58 +08:00
parent 911cfdc980
commit 17d7912e07
1 changed files with 6 additions and 8 deletions

View File

@ -1,10 +1,8 @@
$(function() {
$(document).on('click',"*[data-toggle=buttons-checkbox] input",function(){
var d = $(this).parent().find("input[type=hidden]");
if($(this).is(":checked")){
d.val("1");
}else{
d.val("0");
}
})
$('.module-area [data-toggle=buttons-checkbox]').find('input[type="checkbox"]').each(function() {
$(this).prop('checked') ? $(this).siblings('input[type="hidden"]').val(1) : $(this).siblings('input[type="hidden"]').val(0);
});
$('.module-area').delegate('input[type="checkbox"]', clickEvent, function(event) {
$(this).prop('checked') ? $(this).siblings('input[type="hidden"]').val(1) : $(this).siblings('input[type="hidden"]').val(0);
});
});