-
Sencha Premium Member
How to get value from TextField, before blur event
I have a TextField, and as soon as user starts to enter characters, I want to enable a button. Seems like the text field's getValue() or getCurrentValue() always return null until user hits enter or leaves the field. For example, if I add a keyDownHandler to the textfield, as keys are typed, does not seem that I can get access to the current value of the text field. Maybe I'm going about this the wrong way however.
e.g.
otherText.addKeyDownHandler (new KeyDownHandler() {
@Override
public void onKeyDown (KeyDownEvent event)
{
TextField source = (TextField) event.getSource ();
String v = source.getValue ();
String cv = source.getCurrentValue ();
String t = source.getText ();
// all are null, even though the characters "cc" entered into the field...
// are they accessible anywhere?
}
});
-
Sencha Premium Member
posted too soon, KeyUp seems to work better. :-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules