Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8770793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:37:43+00:00 2026-06-13T17:37:43+00:00

I have jEditable working fine with a textarea to edit the content inside an

  • 0

I have jEditable working fine with a textarea to edit the content inside an object. I’m submitting onBlur using jEditable’s onblur option directly to a function (instead of an url) and all works as expected UNLESS you change windows using for e.g. alt+tab. When I use alt+tab it looks like the content is submitted through an actual http request ignoring my callback function.

My very basic sample implementation looks like this:

$(".editable").editable(function(content,settings){
        content = content.replace(/\n/gi,"<br />");
        return content;
    },{
    data: function(value, settings) {
        return value.replace(/<br[\s\/]?>/gi, '\n');
    },
    type: "textarea",
    onblur: "submit"
});​

You can test it here: http://jsfiddle.net/xmajox/wePp5/

I’ve tried all other window operations: resize, move, etc and even moving between tabs on the browser works great (submits the data and exits the edit mode).

Any ideas of how this might be tamed?

UPDATE:
After a few more tests and some colaboration from other people, it seems that this depends on the os (window manager?). It happens consistently on ubuntu 12.10 with unity but doesn’t happen on mac or windows (haven’t tested other linux boxes).

Also, it is now proved that my callback method does run when I use alt-tab but the form gets POST’d anyway afterwards. Adding a live preventDefault didn’t seem to help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:37:45+00:00Added an answer on June 13, 2026 at 5:37 pm

    Found the fix for this, but coulnd’t quite understand why it happens on such a specific situation.

    First of, I must be the (un)luckiest guy in the world because I’ve tried this on 10ths of other combinations and it didn’t have this problem, only place I could get it to happen was:

     Ubuntu 12.10 (with Unity) and Chrome (v22 at the time of this post)
    

    Disclaimer: This doesn’t mean it does not happen on other places, I just couldn’t reproduce it on the ones I tested (or asked friends to test).

    Problem:
    When focus is lost, jEditable – as of version 1.7.1 – sets a timeout before actually executing any action (200ms by default) to prevent duplicate actions according to the comments in the source. If you (using the above browser/os combination) alt+tab out of the browser window before the timeout is fired (aka. before the data is submitted and your method is ran) it will force a POST request with the data, completely ignoring the preventDefaults or return falses. It won’t have this problem if you press alt… keep it pressed (more than those 200ms, i.e. enough time for the timeout to be fired) and then press alt to move away.

    Solution:
    I edited jEditable’s source to reduce the timeout (or even remove it). So I around line 280, where it says:

    (...)
        input.blur(function(e) {
             // prevent double submit if submit was clicked 
             t = setTimeout(function() {
                  form.submit();
             }, 200);
        });
    (...)
    

    I changed it to:

    (...)
        input.blur(function(e) {
            form.submit();
        });
    (...)
    

    Notes:
    I removed this because on my situation (submitting textareas ONLY on blur and without any other controls that allow the user to submit the data) I coulnd’t reproduce the double submit issue that Mika Tuupola was mentioning on the comments. If you have text input fields (that are submitted pressing enter) with the submit onBlur active, you might fall into that situation. On those cases I suggest you just reduce the timeout or simply avoid to use onBlur submits.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a textarea that I'm able to edit with the jeditable plugin but
I have been using the JEditable plugin for JQuery and I would like to
I'm new to android. I have worked in searchbar using Listview and it's working
I'm using Jeditable with jQuery and it is mostly working how I want it.
I have been working on an HTML editor using an editable iframe that allows
I have this working JS: $(function() { // Class to represent a row in
I have editable grid view, If I click on edit in any row say
I'm using Rails with jQuery, and I'm working on a page for a simple
Here's a simple question. I have a jqGrid that's working great but I want
Not sure why this isn't working. When people click the 'edit' button of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.