I figured it out. If a function is given for the "data" option, it will be
called when creating the input field, and the return from that will be used
to fill the field. So I just did this:

data: function(value) {
 return (value == ' ') ? '' : value;
}

Works great!

--Erik


On 6/11/07, Erik Beeson <[EMAIL PROTECTED]> wrote:

I'm using Mika Tuupola' great jEditable plugin to replace my homegrown
edit-in-place implementation. I've run into a snag when editing blank
fields. When I have a field (a div, not a form field) that's blank, I stick
a &nbsp; in it so the div will still show up. In my implementation, I made
the input box empty if the field only had "&nbsp;" in it. jEditable doesn't
seem to do this, so the field starts out with "&nbsp;" in it, which isn't
ideal. With no onEditStart type event, I can't even fix it dynamically. My
work around has been to use the loadurl feature, but it seems silly to hit
the server for such a small thing.

Obviously it would be trivial for me to just edit the plugin, but I try to
avoid that as much as possible (makes upgrading a nightmare), and this seems
like a legitimate issue. If you try one of the jEditable demos and remove
all of the text and save it, you won't be able to select it again since the
field div has no size when it's empty.

Thoughts?

--Erik

Reply via email to