我有很多次模态的链接。在此模式中,我可以从下拉列表中选择数据。但是每次我调用它时,它都会显示我第一次选择的下拉列表的数据。
这是我如何称呼模态的:
<a data-toggle="modal" href="#example">...</a>
这是我的模态:
<div id="example" class="modal hide fade">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Choose subject and teacher</h3>
</div>
<div>
<form class="contact" name = "form">
<div class="modal-body">
<input type = "text" id = "secret" style = "display:none">
<select name="subjects" id="subjects" onchange="ch()">
<option selected disabled value="default">Subject</option>
<?php foreach($subjects as $subject): ?>
<option value="<?php echo $subject; ?>"><?php echo $subject; ?></option>
<?php endforeach; ?>
</select>
<div id = "filters"></div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary" id="submit">Save</button>
<a href="#" class="btn" data-dismiss="modal">Close</a>
</div>
</div>