Well guys, back to JavaScript Gurus. Here is a script.

PHP Code:
// In head
function myCustomOnChangeHandler(inst) {
    var newLength=250-inst.getBody().innerHTML.length;
    alert(newLength);
}//then in body
<textarea name="limitedtextarea" id="limitedtextarea" cols="60" rows="6"><?=$message?></textarea>
Nw this works fine. Each time I type something in the textarea, I get an alert with the number of characters left in the textarea (250 - number typed). No problem here.

I now want to get this displayed below the textarea, the number of characers left, onchange and also when the page loads, in a span or in a text box.

So, I changed the code slighly
PHP Code:
// In head
function myCustomOnChangeHandler(inst) {
    var newLength=250-inst.getBody().innerHTML.length;
}//then in body
<textarea name="limitedtextarea" id="limitedtextarea" cols="60" rows="6"><?=$message?></textarea>
Characters left => <script type="text/javascript">myCustomOnChangeHandler(limitedtextarea)</script>/250
I am getting an error 'limitedtextarea' is undefined. Also, I am not sure if this is the right code.

Can anyone help?
Thanks for your time friends.
Best.