Revision history [back]

click to hide/show revision 1
initial version

asked 2009-09-04 23:30:31 +0800

windeyu gravatar image windeyu flag of United States

How to intercept the Enter Key in Textbox?

I tried adding an EventListener of "onChanging" type to a Textbox, but the listener doesn't get invoked when the user presses the Enter key inside the Textbox. How do I intercept the Enter key event?

An ugly incomplete solution I attempted is to make the textbox multiline=true rows=1, which will invoke my listener when the Enter-key puts '\n' to the textbox. However, I have to immediately remove '\n' from the textbox, which causes a visual jumping of the text inside the single-line textbox.

Thanks in advance for any better solution. windeyu

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More