当用户从下拉列表中选择某些内容时,以下 jquery 是否有任何原因不起作用。(假设是自动更新)
<script>
$(document).ready(function() {
$("#state").change(function () {
this.form.submit();
})
});
</script>
<form action="avsafety.asp" method="get">
<p>State:<br/>
<select id="state" name="state">
<option label="ACT" value="ACT" <%if request.querystring("state") = "ACT" then response.write("selected") %>>ACT</option>
<option label="NSW" value="NSW" <%if request.querystring("state") = "NSW" then response.write("selected") %>>NSW</option>
<option label="QLD" value="QLD" <%if request.querystring("state") = "QLD" then response.write("selected") %>>QLD</option>
<option label="VIC" value="VIC" <%if request.querystring("state") = "VIC" then response.write("selected") %>>VIC</option>
<option label="SA" value="SA" <%if request.querystring("state") = "SA" then response.write("selected") %>>SA</option>
<option label="TAS" value="TAS" <%if request.querystring("state") = "TAS" then response.write("selected") %>>TAS</option>
<option label="WA" value="WA" <%if request.querystring("state") = "WA" then response.write("selected") %>>WA</option>
</select>
<input type="submit" value="Search" />
</p>
</form>