我想在单击时禁用input
字段 ( ) 。我想使用 jquery,但我没有运气。id = reg
checkbox
这是我的代码:
<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 代码
<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>