Alex Reynolds Alex Reynolds - 1 year ago 118
jQuery Question

How do I use jquery to validate an input field on change?

I have an


<input type="text" name="notifyEmail" id="parametersEmail" value="" size=40 />

I have a chunk of jquery code that works when I hit tab or otherwise leave the field, which calls a validation routine:

$("#parametersEmail").blur(function(event) {

What I would like to do is run the
function whenever the value or content of the input field changes.

So I then also tried the

$("#parametersEmail").change(function(event) {

But when I change the contents of
, this handler does not call the validation function.

Is there another handler I should be using, instead? Or can I not attach multiple event handlers to the input field?

Ish Ish
Answer Source

Try $("#parametersEmail").keydown(function(event) {})

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download