selecte设置不可用使用disabled属性注意
生活随笔
收集整理的這篇文章主要介紹了
selecte设置不可用使用disabled属性注意
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
場景
在新增時select可以下拉選擇,
在編輯時select不可以下拉選擇。
所以需要控制其屬性,這里通過thymeleaf模板來實現。
注意:
使其禁用時:disabled="disabled"
使其啟用時:disabled="false"
實現
<select class="form-control" name="businessInitiator"? id="businessInitiator"? th:attr="disabled=${refundOrder != null?'disabled':'false'}" >效果
總結
以上是生活随笔為你收集整理的selecte设置不可用使用disabled属性注意的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Jquery控制select实现data
- 下一篇: Thymeleaaf中设置属性值实现动态