利用themlef回顯select中的數據

<select name="upgtype" style="border:1px solid #939393;width:200px;height:30px;"  >
        <option th:each="li:${types}"  th:value="${li.tid}" th:text="${li.tname}" th:selected="${li.tid eq nowtid}" >類型</option>
      </select>

注意!!!!th:selected="${li.tid eq nowtid}"中比較的類型一定要一樣,嗚嗚嗚,找了好久的錯誤,一直沒反應,原來問題出在這。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章