我有一个带有搜索过滤器的网页来缩小结果范围。您可以单击结果转到其详细信息页面,但如果您使用浏览器的“返回”按钮返回搜索结果,过滤器将全部消失。将过滤器选项包装在“FORM”元素中以便它们持续存在是不好的做法吗?
前:
<div class="sort-results classes">
<select id="select-classes" name="sort-classes">
<option selected="selected" value="">Sort by</option>
<option value="price-ascending" data-order="asc" data-sort="class-price">Price: Lowest</option>
<option value="price-descending" data-order="desc" data-sort="class-price">Price: Highest</option>
...
</select>
</div>
后:
<div class="sort-results classes">
<form>
<select id="select-classes" name="sort-classes">
<option selected="selected" value="">Sort by</option>
<option value="price-ascending" data-order="asc" data-sort="class-price">Price: Lowest</option>
<option value="price-descending" data-order="desc" data-sort="class-price">Price: Highest</option>
...
</select>
</form>
</div>