大家好, 我正在用django练习写个小网站
但碰到了一个问题,找不到范例可以参考
我希望网页能显示如下:
选择: A下拉选单 B下拉选单
建议: C
能不能让C的显示内容依照A、B下拉选单而不同呢?
假设A选1 B选2 > C显示ex1
A选2 B选2 > C显示ex2
我的html长这样:
<table>
<tr>
<td>Type: </td>
<td align="center">
<select name="DV_type">
{% for type in variable_type %}
<option name="DV_type" value={{ type }}>{{ type }}</option>
{% endfor %}
</select>
</td>
<td align="center">
<select name="IV_type">
{% for type in variable_type %}
<option name="IV_type" value={{ type }}>{{ type }}</option>
{% endfor %}
</select>
</td>
</tr>
<tr>
<td>Suggestion: </td>
<td colspan="2" align="center"> {{ model_suggestion }}</td>
</tr>
</table>
总之我希望网页显示的内容依使用者的选择而变化,但停留在同一页
有办法在django里做到吗?
谢谢!!