i want disable input
field (id = reg
) on clicking checkbox
. want use jquery, did no luck.
here code:
<head> <meta charset="utf-8"> <title>fims</title> <meta name="description" content="sales tracking system"> <title>fims::data analyst</title> <link rel="stylesheet" href="../bootstrap/css/bootstrap.css"> <link rel="stylesheet" href="../includes/my_style_sheet/my_style.css"> <link rel="stylesheet" href="../includes/my_style_sheet/mys_style_sheet.css"> <link rel="stylesheet" href="../includes/my_js/smoothness/jquery-ui-1.9.1.custom.css"> <script type="text/javascript" src="../includes/my_js/js_library.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#all').change(function(){ $('#reg').attr("disabled","disabled"); }); }); </script> </head>
html code
<div class="control-group"> <label class="control-label" for="id_password">choose district</label> <div class="controls"> <select class="bootstrap-select" name="district" id="dis" disabled='disabled'></select> </div> </div> <div class="control-group"> <label class="control-label" for="id_password">regionwise</label> <div class="controls"> <label class="checkbox"> <input type="checkbox" name="all" id="all"> </label> </div> </div>
you can this:
$(document).ready(function () { $('#all').change(function () { $('#reg').prop("disabled", this.checked); }); });
Comments
Post a Comment