WebDialog enter key press not working

Is there a way to get the enter key press in a web dialog? In a HTMLDialog it works fine but in a WebDialog the enter key press is ignored.

This is an example from W3Schools.com. ```

Press a key on the keyboard in the input field to get the Unicode character code of the pressed key.

```

I have no idea, the enter key triggers only rarely for double/multiple presses (in your setup WebDialog uses the OS-provided version of Internet Explorer).
Try onkeyup, it seems to work reliably.

Keypress works in internet explorer.
I just checked and onkeyup works in WebDialog.

Also in Windows the onkeyup is trapped when inside a drop down list but only for WebDialog.

The enter key with HTMLDialog is used to open the drop down list or if opened to choose the item from the list. Having said that you can trap the onkeydown when focus is on a drop down list.

There are a few other differences as well.

You might consider using MDN as a reference. I’m a windows type, and it’s got a lot of info re browser compatibility.

From the first line of MDN keypress event -

‘The keypress event is fired when a key is pressed down, and that key normally produces a character value’

Hence, to test for navigation keys, etc, keydown & keyup are used, as noted above. Input event is also used with text type controls (and selects).

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.