jEditable submit on TAB as well as ENTER

戏子无情 提交于 2019-12-05 17:05:52

You could bind a click event after .editable(), so it is triggered after the jEditable's event, which set up the form. Then bind a keydown event to the text box that listens to the TAB key. So, assuming you're dealing with a text box, you can do something like the following:

$('.editable').editable('url', {
    ...
}).click(function(evt) {
    $(this).find('input').keydown(function(event) {
        if (event.which == 9) //'TAB'
            $(this).closest('form').submit();
    });
});

See this in action: http://jsfiddle.net/william/6VUHh/5/.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!