最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Having jeditable save when focus is lost? - Stack Overflow

programmeradmin1浏览0评论

(How) can I tweak jeditable to save the text when focus is lost from the text area? If you don't supply submit/cancel buttons, then when pressing 'Enter' the content is saved ... but I haven't found how to save the content on focus lost.

(How) can I tweak jeditable to save the text when focus is lost from the text area? If you don't supply submit/cancel buttons, then when pressing 'Enter' the content is saved ... but I haven't found how to save the content on focus lost.

Share Improve this question edited May 15, 2010 at 8:48 Nick Craver 631k138 gold badges1.3k silver badges1.2k bronze badges asked May 15, 2010 at 8:17 ripper234ripper234 230k280 gold badges646 silver badges914 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

You can do this by setting the onblur option, like this:

$('.editable').editable('myPage.php', {
  onblur: 'submit'
});

Inside jEditable this is what happens:

} else if ('submit' == settings.onblur) {
   input.blur(function(e) {
     t = setTimeout(function() { form.submit(); }, 200);
   });
}

There are detils for the onblur option at the bottom of the jEditable post here, just search for "onblur" in the page.

发布评论

评论列表(0)

  1. 暂无评论