Search This Blog

Labels

adobe (1) android (3) apache (3) aviation (1) bash (2) chrome (2) composer (1) cookery (3) dev (2) dodanperks (1) extensions (1) facebook (2) firefox (1) git (2) grafana (1) guzzle (1) headaches (12) htaccess (1) html5 (2) jquery (2) lamp (1) life hacks (10) linux (29) mysqli (2) native (1) opera (2) php (10) railfanning (1) reactjs (3) reactnative (1) servers (11) sinhala (1) smartphones (2) snap (1) sound (1) tech (22) troubleshoots (5) ubuntu (30) unicode (4) virtualbox (1) wamp (2) web (11) windows (4) wordpress (3) youtube (2) කෑම (3)

Sunday, 29 June 2014

Play check boxes with jQuery

<script src="scripts/jquery-2.1.1.min.js"></script>
<script>
$(document).ready(function(){
/*
$('.c_ch_check').attr("disabled","disabled");
 $('#c_change').click(function(){
  $('.c_ch_check').removeAttr("disabled");
 });
 
 $('#e_reg').click(function(){
  $('.c_ch_check').attr("disabled","disabled");
 });
 
 $('#info').click(function(){
  $('.c_ch_check').attr("disabled","disabled");
 });
*/
/*-------------------------------------------------*/ $('.c_ch_check').attr("disabled","disabled"); $('input[name="up_type"]').click(function(){ if($('#c_change').is(':checked')){ $('.c_ch_check').removeAttr("disabled"); }else{ $('.c_ch_check').attr("disabled","disabled"); } }); /*-------------------------------------------------*/ $('.c_add_text').attr("disabled","disabled"); $('#c_add').click(function(){ if($('#c_add').is(':checked')){ $('.c_add_text').removeAttr("disabled"); }else{ $('.c_add_text').attr("disabled","disabled"); } }); }); </script>
<input type="radio" name="up_type" value="c_change" id="c_change" /><label for="c_change">Course changes</label>
            <input type="checkbox" value="1" class="c_ch_check" name="c_add" id="c_add" /><label for="c_add">Add only</label>
Affected course units
                        <input type="text" name="affected_c" class="c_add_text" placeholder="Comma seperated list accepted" required/>
            <input type="checkbox" value="1" class="c_ch_check" name="c_remove" id="c_remove" /><label for="c_remove">Remove only</label>
            <input type="checkbox" value="1" class="c_ch_check" name="c_int_change" id="c_int_change" /><label for="c_int_change">Inter change</label>
<input type="radio" name="up_type" value="e_reg" id="e_reg" /><label for="e_reg">Exam registrations</label>
<input type="radio" name="up_type" value="info" id="info" /><label for="info">Information letters</label>

No comments:

Post a Comment