1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<input id="toggle-event" data-client="<?php echo $clientid ?>" <?php if ($hideorshow=="no") {echo "checked";} ?> type="checkbox" data-toggle="toggle" class="toggle" data-on="SHOWING" data-off="HIDDEN" data-onstyle="success"> <div id="console-event"></div> <script> $(function() { $('#toggle-event').change(function() { var myclient = $(this).attr('data-client'); var thistoggle = $(this).prop('checked'); alert(thistoggle+myclient); $.ajax({ url: "hiddenclient.php", dataType: "html", type: 'POST', data: "clientid="+myclient+"&status="+thistoggle, success: function(data){ $("#page-wrapper").load('clients.php').fadeIn('slow'); } }); // $('#console-event').html('Toggle: ' + $(this).prop('checked')) }) }) </script> |
