On Oct 22, 2007, at 2:04 PM, Johny wrote:


I have
  <textarea id="id_Message" class="vLargeTextField" name="Message"
rows="8" cols="40"></textarea>

how can I count numbers of characters that a user writes?
Thank you
B.


Hi Johny,

Let's say you have <div id="foo"></div> below the textarea. You could do this:

$('#id_Message').keyup(function() {
  var charLength = $(this).val().length;
  $('#foo').html(charLength);
});

That will put the number of characters from your textarea into the div.


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com


Reply via email to