<div id="dept-or-user-div" class="panel" style="padding-bottom:10px;">
<h3 class="div-title">Select Alert Recipients</h3>
<div class="recipient-error" style="display:none;"><p style="padding-top:10px; color:#f00;">Please select at least one recipient</p></div>
<p>
<input type="radio" checked value="dept" name="user-or-dept">Department</input>
<input type="radio" value="user" name="user-or-dept">User</input>
<input type="radio" value="both" name="user-or-dept">Both</input>
</p>
<div class="department-select" class="dept">
<p><label for="department-choice">Department:</label>
<select name="department-choice" id="department-choice">
<option></option>
<?php
echo get_departments();
?>
</select></p>
</div><!--end #department-select-->
<div class="user-select user" >
<p><label for="user-choice">User:</label>
<select name='user-choice' id="user-choice">
<option></option>
<?php
echo get_users('option');
?>
</select></p>
</div><!--end #user-select-->
</div><!--end #dept-or-user-div-->
这里我有三个单选按钮
- 部门(部门下拉菜单)
- 用户(用户下拉菜单)
- 两者(用户和部门 dropwon)
And what I want to do this when radio button with value "Both" ie third radio button is selected, I want to call a js function and dynamically populate users dropdown depending department value. 我怎样才能做到这一点?