The wordpress plugin to modify is
AJAX EDIT COMMENTS 2.3.2.1.
http://wordpress.org/extend/plugins/wp-ajax-edit-comments/
I’m running wp 271.
In my comment form I have a 2.000 characters limiter, working when a user INSERT a comment.
This doesn’t work when a user EDIT his comment with WP Ajax Edit Comments. I need a characters limiter working when a user EDIT his comment.
You can use my code or some other one that best fit with the plugin.
This is how I installed my 2.000 characters limiter in comment form:
=============================================================
IN theme/header.php
before
</head>
add:
<script language=”JavaScript” type=”text/javascript”>
<!– Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long…trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update ‘characters left’ counter
else
countfield.value = maxlimit – field.value.length;
}
// End –>
</script>
=============================================================
in theme/comments.php
change
<textarea name=”comment” id=”comment” cols=”70″ rows=”4″ tabindex=”4″></textarea>
with this:
<p><textarea name=”comment” id=”comment” cols=”70%” rows=”10″ tabindex=”4″ onkeydown=”textCounter(this.form.comment,this.form.remLen,2000);” onkeyup=”textCounter(this.form.comment,this.form.remLen,2000);” onmousemove=”textCounter(this.form.comment,this.form.remLen,2000);” onmouseout=”textCounter(this.form.comment,this.form.remLen,2000);”></textarea></p>
<p><input type=”text” name=”remLen” size=”3″ maxlength=”4″ value=”2000″ />characters left</p>
=============================================================
Regards,
JuliusB