第一页中的两个选择选择应该在窗口上。它的工作正常。 当我点击.btn-sm(按钮)加载灯光窗口/弹出窗口选择 - 选择加载数据但无法选择
我做错了什么?
HTML(窗口):
<div class ="form-group">
<label for="deptselection" class="col-sm-4 control-label id">Category</label>
<div class="col-sm-4">
<!-- chosen-select" data-placeholder="Choose a Doctor..." tabindex="2" -->
<!-- selectpicker" data-size="5" data-live-search="true" -->
<select id ="catgselection" multiple = "" name="catgselection[]" class="form-control chosen-select" data-placeholder="Choose a Category..." tabindex="2">
<?php
if(!empty($catg))
{
$i=1;
foreach ($catg as $key => $value)
{
echo "<option value=".$value->id.">".$value->category."</option>";
$i++;
}
}
?>
</select>
</div>
</div>
Html:Light window / pop up
<div class ="form-group">
<label for="catgselection_ed" class="col-sm-4 control-label id">Category</label>
<div class="col-sm-4">
<!-- chosen-select" data-placeholder="Choose a Doctor..." tabindex="2" -->
<!-- selectpicker" data-size="5" data-live-search="true" -->
<select id ="catgselection_ed" multiple = "" name="catgselection_ed[]" class="form-control chosen-select2" data-placeholder="Choose a Category..." tabindex="2">
<?php
if(!empty($catg))
{
$i=1;
foreach ($catg as $key => $value)
{
echo "<option value=".$value->id.">".$value->category."</option>";
$i++;
}
}
?>
</select>
</div>
</div>
<script>
$( document ).ready(function() {
$(".chosen-select").chosen(); // for main window
$('.scroll').scrolltable({
stripe: true,
oddClass: 'odd'
});
});
$(document).on("click", ".btn-sm" , function() {
$(".chosen-select2").chosen(); // for light window
});
}
</script>