Forum Moderators: open
Is there a way to differentiate between an ENTER in the expanded portion of a drop-down, and an ENTER someplace else?
Thanks in advance for any advice :)
you can disable any form submission temporarily by setting its onsubmit event to a function that returns false...
onsubmit=function(){return false;}
the trick is to disable submit while the dropdown is active, and re-enable it when the select dropdown is not. I'm not sure if onblur and onfocus are going to do that for you.
I didn't think select boxes had that problem. Usually when you're keying through options, you can press Enter to select that option... One usually relies on the standard behaviours of the HTML elements because overriding them is nasty business.
Maybe it's possible to capture the Enter key; and when Enter is pressed check if a select box is focused, disable the form submit if true. Just a thought