You need to add go() to your
for it to work as it needs to populate span#charleft with the character limit. I used a schedule script to do this, but body onload should work fine. [b]HTML[/b]
[b]Javascript[/b]
function go()
{
// Number of characters
var LIMIT = 50;
// Get the elements to fiddle with
var textarea = document.getElementById('message');
var span = document.getElementById('charleft');
// if the textarea has less letters then the
// limit, update span with the number of characters
if (textarea.value.length <= LIMIT)
{
var newspan = parseInt(LIMIT) - parseInt(textarea.value.length);
span.innerHTML = newspan;
}
// if the textarea has more, trim down to LIMIT
else
{
textarea.value = textarea.value.substring(0, LIMIT);
}
}