jQuery:从下拉列表中选择一个值后提交表单 [英] jQuery: submit form after a value is selected from dropdown
本文介绍了jQuery:从下拉列表中选择一个值后提交表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的HTML中有此表单:
I have this form in my HTML:
<form action="/awe/ChangeTheme/Change" method="post">
<select id="themes" name="themes">
...
<option value="blitzer">blitzer</option>
</select>
<input type="submit" value="change" />
</form>
在主题"下拉列表中选择一个值时,有人知道如何提交吗?
Anybody knows how to submit it when a value is selected in the 'themes' dropdown?
推荐答案
其他解决方案将在页面上提交所有表单(如果有的话).更好的是:
The other solutions will submit all forms on the page, if there should be any. Better would be:
$(function() {
$('#themes').change(function() {
this.form.submit();
});
});
这篇关于jQuery:从下拉列表中选择一个值后提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文