I have a textarea that I'm able to edit with the jeditable plugin but I do not want the OK and Cancel buttons. I am, instead, going to save the text by clicking away from the textarea (blur). I have that code ready to go but I do not know how to make it work.
+3
A:
Simply add this to the hash with the settings:
onblur : 'submit'
Example:
$(document).ready(function() {
$("#editable1").editable("http://www.domain.com/editdata/", {
indicator : "<img src='img/indicator.gif'>",
type : 'textarea',
onblur : 'submit',
tooltip : 'Click to edit...',
cancel : 'Cancel'
});
});
Hope it helps,
Cheers
Marcos Placona
2010-03-08 15:14:00
You can omit "cancel" if you don't want the Cancel button, but the user will need to know to hit ESC if they don't want the changes persisted.
tvanfosson
2010-03-08 15:16:24
And that's why I left it in there, and just removed the submit :-)
Marcos Placona
2010-03-08 15:18:52
Thank you VERY much mplacona. I completely missed the onblur
Adam
2010-03-08 15:23:50
I'd advise you to marl the answer as responded then, so it can be used for future reference.Glad it helped you
Marcos Placona
2010-03-08 15:43:26