当这个表单由onchange
事件提交时,它不会保留get变量view
。任何想法为什么会这样?提交时,这是它的网址,index?month=February&year=2014
<form action="index?view=list" class="pure-form pure-form-aligned" style="margin:20px;">
<select name="month" onchange="this.form.submit();">
<option value="January">January</option>
<option value="February">February</option>
</select>
<select name="year" onchange="this.form.submit();">
<option value="2014">2014</option>
<option value="2013">2013</option>
<option value="2012">2012</option>
</select>
</form>
答案 0 :(得分:1)
只需在表单中添加隐藏的输入字段:
<input type="hidden" name="view" value="list" />