我希望这个表单在页面加载后提交,并且我使用下面的代码来完成它。问题在于页面不断重新加载并停留在该循环中。'Submit'onload进入循环
HTML
<body onload="document.getElementById('filters').submit();">
<form id="filters" method="post">
<section>
<select id="Genre" name="genres" >
<option value="Select Genre">Select Genre</option>
<option value="All">All</option>
{% for row in genre %}
<option value="{{row.genre}}">{{row.genre}}</option>
{% endfor %}
</select>
<select id="Rating" name="ratings" >
<option value="Select Rating">Sort by Rating</option>
<option value="Best">Best</option>
<option value="Rating_IMDB">IMDB</option>
<option value="Rating_RT">Rotten Tomatoes</option>
</select>
</section>
</form>
</body>
您需要在您的形式 –
设置一个动作你将永远无法因为这个不提交作出一些改变访问此页面。我们不知道这些确切的变化需要做什么,因为所有这些的预期流程没有问题 – charlietfl