Hi all, I'm using a fairly complex jEditable implementation to provide
'edit in place' functionality for every individual word in a div.

Everything works as I would expect with one exception: the onblur
behaviour is erratic. Sometimes it works as expected (i.e. I click on
a word, edit it, then the edited word replaces the original word in my
text). Other times it appears to submit the whole page back to itself
with the single change I made sent as the querystring, losing all
other changes I made previously:

editinplace.html?value=MyNewWord

To note: I'm not submitting to another file via ajax. I'm running an
inline function to store my serialised changes in a hidden form
element which then gets submitted along with other payload from an
external system. And I'm wrapping up the whole .editable() behaviour
in a larger .click() function, as I need to do things before and
after .editable() is initiated.

Does anyone know what might be causing this unpredictable behaviour?
Could it be something to do with how I'm triggering .editable() ?

Code snippet:

$(".edit").click(function() {
        //Word out the wordId
        var wordId = "p0w0";

        // ...do some stuff

        $('#' + wordId).editable(
                function(value, settings) {
                        return value;
                },
                {
                event           : 'editme',
                style           : 'inherit',
                onblur          : 'submit',
                callback        : function(value, settings) {
                        // Do stuff or not depending on returned value
                }
        });

        // ...some other stuff

        // TRIGGER THE JEDITABLE EVENT
        thisWord.trigger('editme');
});

Reply via email to