David
David

Reputation: 4271

How to take the value from textfield and read on key press event

I am trying to read text present in the textfield. I need to read every character enter at the time when it enter, So therefor I am using

keypress: function(cmp,e) { 
        cmp.value;
        cmp.getValue();
    }

But this event is fireing as soon as I pressed key. So it not taking the value of key which I entered. It taking in second time. How to resolve it.

How to take the value from textfield and read on key press event

Upvotes: 0

Views: 1103

Answers (1)

Faizal
Faizal

Reputation: 250

Use keyup event instead of keypress event.

Check below link for more details.

onKeyPress Vs. onKeyUp and onKeyDown

Upvotes: 2

Related Questions