+1  A: 

Attach your handler to the keyrelease event. The value should have been updated by then.

Aaron Digulla
+2  A: 

have you tried using the keyUp event?

Nimnam1
+1  A: 

Use the keyup event instead.

Anurag
A: 
    $('.A, .B').keydown(function(event) { 
    if(!empty($('.A').val()) && !empty($('.B').val()))
        $(".C").attr("disabled","");
    else
        $(".C").removeAttr("disabled");
    });
mjw06d
A: 

At the keypress event, the value of the INPUT is not yet set. Hence you can't easily know if it is empty.

While the keyup fires, the value of the INPUT is set.

But things get worse. The user can empty the field with the mouse or the Edit menu of the browser. In that case keyup is not fired.

In our web app we auto-save the values.
Like in Mac OS, if you know, there is almost no save buttons.

To allow a reaction here is more or less what we do:

  1. onfocus: a setInterval starts polling every 120ms or so, and checks the input for any change
  2. if there is a change do the relevant action
  3. onblur: a clearInterval stop the polling
Mic
A: 

use a combination of handlers for keyup and change. the keyup handler will update as the user types (excepting edge cases like holding a key down, which doesn't seem like a concern here) and the change handler will catch things like the user cutting the text with mouse actions before they can switch to field C. as an added measure you could add verification on field C's focus event, to make sure A and B really have something.

lincolnk