Сделайте это способом jQuery:
$('#name').keyup(function() { alert('Content length has changed to: '+$(this).val().length); });