Jquery帮助onclick选项

Jquery帮助onclick选项,jquery,ruby-on-rails,ruby-on-rails-3,Jquery,Ruby On Rails,Ruby On Rails 3,我试图在提交表单时呈现finder $('option').click(function () { $(this).closest('form').submit(); }); $("#konkurrancer").html("<%= escape_javascript(render("finder")) %>"); $(“选项”)。单击(函数() { $(this).closest('form').submit(); }); $(“#konkurancer”).html(“

我试图在提交表单时呈现finder

$('option').click(function ()
{
    $(this).closest('form').submit();
});
$("#konkurrancer").html("<%= escape_javascript(render("finder")) %>");
$(“选项”)。单击(函数()
{
$(this).closest('form').submit();
});
$(“#konkurancer”).html(“”);

尝试将代码更改为:

$('select').change(function ()
{
    $(this).closest('form').submit();
});
$("#konkurrancer").html("<%= escape_javascript(render("finder")) %>");
$('select')。更改(函数()
{
$(this).closest('form').submit();
});
$(“#konkurancer”).html(“”);

有什么问题吗?请提供更多信息。按下选项时如何提交表格?