We have to find a way to add :
$(".editInPlace").attr("maxLength", 180);
Somewhere.
So we have to find a "hook" to set this attribute to the textarea when it pops out. I tried to look for this kind of hook in the documentation of the plugin but did not find one.
If nobody finds a better way to solve your problem, you can change the library's source code directly.
createEditorElement: function() {
if (-1 === $.inArray(this.settings.field_type, ['text', 'textarea', 'select']))
throw "Unknown field_type <fnord>, supported are 'text', 'textarea' and 'select'";
var editor = null;
if ("select" === this.settings.field_type)
editor = this.createSelectEditor();
else if ("text" === this.settings.field_type)
editor = $('<input type="text" ' + this.inputNameAndClass()
+ ' size="' + this.settings.text_size + '" />');
else if ("textarea" === this.settings.field_type)
editor = $('<textarea ' + this.inputNameAndClass()
+ ' rows="' + this.settings.textarea_rows + '" '
+ ' cols="' + this.settings.textarea_cols + '" />');
return editor;
},
And before returning "editor", add something like this:
if(this.settings.textarea_maxLength) {
editor.attr("maxLength", this.settings.textarea_maxLength);
}
Then you'll have to set the "maxLength" attribute as an option field when you instantiate the editInPlace
:
$("#editme1").editInPlace({
/* the options you had before */
textarea_maxLength: 180
});
But it seems a bit tricky and I didn't test it, maybe you should consider asking the plugin's developer directly.
oops I didn't refresh the page before posting, sorry. This is basically the same solution as @pln