Помогите, нужен счетчик textarea
, как в твиттере, чтобы разрешал писать дальше но уходил в минус, можно это исправить:
function length_check(len_max, field_id, counter_id) {
var len_current = document.getElementById(field_id).value.length;
var rest = len_max - len_current;
if (len_current > len_max )
{ document.getElementById(field_id).value =
document.getElementById(field_id).value.substr (0, len_max);
if (rest > len_max) { rest = len_max;}
document.getElementById(counter_id).firstChild.data = rest;
}
else
{ document.getElementById(counter_id).firstChild.data = rest; }
}