<div class="col-sm-8">
    <select data-placeholder="请选择实验室"  id="laboratoryId" name="laboratoryId"  class="form-control chosen-select" style="width: 100%; "  required >
        <option   value=""   selected>请选择</option>
        <option   th:each="laboratoryDO:${laboratoryDOList}" th:value="${laboratoryDO.laboratoryId}"  th:text="${laboratoryDO.labName}" ></option>
    </select>
</div>

js

<script type="text/javascript" th:inline="javascript">
    $().ready(function() {
        var single = [[${laboratoryId}]];
        $("#laboratoryId option[value= " + single + "]").prop("selected",true);
    });
</script>

后台

model.addAttribute("laboratoryId",laboratoryId);

相关文章:

  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2021-11-18
猜你喜欢
  • 2021-11-18
  • 2021-11-18
  • 2021-07-12
  • 2021-11-18
相关资源
相似解决方案