Copy of ExtJS 2001 - ExtJS textfield capture Caps Lock key event

ExtJS textfield capture Caps Lock key event

Posted on

Copy of ExtJS 2001 - ExtJS textfield capture Caps Lock key event

Many times when you create a login form which has password field, you need to make sure the user enter valid password. The changes of entering wrong password by the user may also lead to blocking of account. To minimize the error we can tell user to enter correct password and display error/warning message if Caps Lock key is on.

ExtJS textfield component comes with a keypress listener which we can use to check which key user has entered. To capture any pressed key for textfield we need to listen keypress event as follows.

Output:

ExtJS caps lck on - ExtJS textfield capture Caps Lock key event

Download Source

Source techzoo.org