Hi,

I am trying to make a function that does an AJAX request if the user typed at least 3 chars in a text field. I have tried:

  $(document).ready(function(){
   $('#term').keyup(function(){
    if ($(this).val().length >= 3) {
     sendValue($(this).val());
    }
   });
  });

If I type at least 3 chars, the script works fine, and I am able to select/deselect the chars in the text field.
But after typing only one or two chars, I can't make the selection.

If I delete the line:

    if ($(this).val().length >= 3) {

(and its corresponding "}")

then the script works fine and I can select/deselect the chars with the keyboard after I type them.

Does anyone know what I might be doing wrong?

Thanks.

Octavian

Reply via email to