【发布时间】:2016-10-17 11:23:30
【问题描述】:
我正在尝试创建一个用户表单,但我被困在其中,因为我希望如果选中单选按钮然后显示一个 div。我无法做到这一点,因为我在 javascript 方面有点弱。请在下面找到我的代码。 我的按钮是
<label>
<input type="radio" name="groups[]" value="6"> Head of Distribution Sales
</label>
选择按钮后我想显示这个 div
<div class="form-group">
<label class="col-md-3 control-label">Regions</label>
<div class="col-md-9">
<div class="checkbox-list">
<label>
<input type="checkbox" name="groups[]" value="43"> Dhaka North
</label>
<label>
<input type="checkbox" name="groups[]" value="44"> Dhaka South
</label>
<label>
<input type="checkbox" name="groups[]" value="45"> Comilla
</label>
<label>
<input type="checkbox" name="groups[]" value="46"> Chittagong
</label>
<label>
<input type="checkbox" name="groups[]" value="47"> Khulna
</label>
<label>
<input type="checkbox" name="groups[]" value="48"> Mymensingh
</label>
<label>
<input type="checkbox" name="groups[]" value="49"> Sylhet
</label>
<label>
<input type="checkbox" name="groups[]" value="50"> Rangpur
</label>
<label>
<input type="checkbox" name="groups[]" value="51"> Bogra
</label>
<label>
<input type="checkbox" name="groups[]" value="52"> Barisal
</label>
</div>
</div>
</div>
请帮我解决这个问题。
【问题讨论】:
-
首先显示你的 jquery 代码你尝试了什么
-
是否存在其他单选按钮?还是只有它一个?
-
你需要给出完整的HTML结构,如果没有Radio按钮,那么只有我们给出了解决方案。
标签: javascript php jquery twitter-bootstrap codeigniter