- $(':checkbox').on('change', function(event){
- if(this.checked) {
- $(this).val(1);
- var id = $(this).attr('id');
- $("."+id).remove();
- }else{
- var name = $(this).attr('name');
- var cls = $(this).attr('id');
- $(this).after( "<input type='hidden' name='"+name+"' class='"+cls+"' value='0'/>" );
- }
- });