ddSlick选择更改提交表单

时间:2015-01-11 23:19:45

标签: javascript jquery select drop-down-menu

我正在使用ddslick。是否可以在变更时提交表格?

我的代码:

<form method="post" class="town_form">
     <select name="town" id="select_town">
         <option value="83">Chicago</option>
         <option value="112">New York</option>
     </select>
</form>

<script>
    $('#select_town').ddslick({
        onSelected: function(selectedData){
            $('.town_form').submit();
        }
    });
</script>

但它没有用......有什么帮助吗?

1 个答案:

答案 0 :(得分:0)

$('#select_town').dblclick(function() {
    onSelected: function(data){
        if (data.selectedIndex > 0) {
            $('form.town_form').submit();
        }
    } 
});