thymeleaf的下拉框(select option)回显选中

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">套餐类型:</label>
                <div class="col-sm-8">
                    <select data-placeholder="请选择套餐类型"  name="comboTypeId" class="form-control"   required>
                        <option   value="" >请选择</option>
                        <option   th:each="comboType:${comboTypeList}" th:value="${comboType.id}" th:text="${comboType.comboName}"></option>
                    </select>
                </div>
            </div>

数据回显

           <div class="form-group">
                <label class="col-sm-3 control-label is-required">套餐类型:</label>
                <div class="col-sm-8">
                    <select name="comboTypeId"  data-placeholder="请选择套餐类型" class="form-control" required>
                        <option th:each="comboType : ${comboTypeList}" th:text="${comboType.comboName}" th:value="${comboType.id}" th:selected="${comboType.id} eq ${baseClientInfo.comboTypeId}"></option>
                    </select>
                </div>
            </div>

 

thymeleaf的下拉框(select option)回显选中

上一篇:for,增强for,Iterator迭代器循环


下一篇:TP6框架获取参数的方式