本程序实现在Django中使用省市联动模型,并实现地址值允许输入一次的效果:
1.前端引入
##html中引入
{% if request.user.province %}
<li class=" p_infor_city">地 址: <input type="text" value="{
{request.user.province}}{
{request.user.city}}" readonly="readonly"/>
</li>
{% else %}
<li class=" p_infor_city">地 址:
<select id="province" style="width:140px" name="province">
<option value="0">--请选择--</option>
</select>
<select id="city" style="width:140px;" name="