django前端页面下拉选择框默认值设置

版权声明:学习是一种信仰。喜欢就拿去,送人玫瑰手有余香。 https://blog.csdn.net/huoyuanshen/article/details/83347084

1,前端样式

2,前端html代码

<select name="row.status">
    <option value="ON" {% if row.status == 'ON' %} selected="selected" {% endif %}>ON</option>
    <option value="OFF" {% if row.status == 'OFF' %} selected="selected" {% endif %}>OFF</option>
</select> 

猜你喜欢

转载自blog.csdn.net/huoyuanshen/article/details/83347084