-1

I would want the function to detect whether there is text in a text field typed in by a user. Not necessarily keyup. I wouldn't want it to fire every time I type in the field. I would want it to detect whether there is text in the field or not.

iii
  • 606
  • 1
  • 6
  • 21
  • 2
    Do you mean the [`input` event?](https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/oninput) – Mike Cluck Jun 01 '16 at 15:55

2 Answers2

1

html <input> tags including type='text' support the onchange event. The onchange event occurs when the value of an element has been changed.

I wouldn't want it to fire every time I type in the field.

in this case, when exactly would you want it to be triggered? onblur event occurs when an object loses focus.

CaffeineAddiction
  • 803
  • 1
  • 14
  • 29
  • for me it's the proper way wait that the element have really change and after check the lenght or the value to determine if it's empty or filled – jeremy-denis Jun 01 '16 at 16:04
0

You have 2 another events like 'blur' or 'focus'

Michael Rasoahaingo
  • 1,069
  • 6
  • 11