I have a JQueryDialog with a text field, an OK button and a cancel button.
I want to be able to hit the enter key after filling in the text fields and have it do the same action as when I click the OK button.
I have a JQueryDialog with a text field, an OK button and a cancel button.
I want to be able to hit the enter key after filling in the text fields and have it do the same action as when I click the OK button.
The code is almost correct. I would change the if comparison and use the correct method as noted below.
if (KeyEvent.VK_ENTER == event.getKeyCode()) {
yourButton.doClick();
}