Closed
Bug 389646
Opened 19 years ago
Closed 19 years ago
alt and ctrl key press are undefined in the event object when used in onchange event handler
Categories
(Core :: DOM: Events, defect)
Core
DOM: Events
Tracking
()
RESOLVED
INVALID
People
(Reporter: skanchi, Unassigned)
Details
Attachments
(1 file)
|
522 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20061201 Firefox/2.0.0.5 (Ubuntu-feisty)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20061201 Firefox/2.0.0.5 (Ubuntu-feisty)
The altkey and ctrlKey are set to undefined state in the event object used in the onchange event handler
below is the example code:
<script language="javascript" type="text/javascript">
function ev_handler(ev) {
alert(" altKey pressed: " + ev.altKey +
" ctrlKey pressed: " + ev.ctrlkey);
return;
}
</script>
<select onchange="javascript: ev_handler(event)">
<option value='1'>one
<option value='2'>two
<option value='3'>three
</select>
Reproducible: Always
Steps to Reproduce:
1. run the above code
2. change select option with alt or ctrl key pressed
3. alert message shows key press as undefined
Actual Results:
shows keypress during an onchange event is undefined
Expected Results:
should have return a bool value of the key press (even in onchange event)
this works with IE7
Updated•19 years ago
|
Component: General → DOM: Events
OS: Linux → All
Product: Firefox → Core
QA Contact: general → events
Hardware: PC → All
Version: unspecified → Trunk
Comment 1•19 years ago
|
||
Comment 2•19 years ago
|
||
change event is not a mouse event, nor key event, so altKey and ctrlKey aren't
defined. That is per W3C DOM Events spec. So this is INVALID unless we want to
support these IE's extensions.
Comment 3•19 years ago
|
||
Thanks, Smaug. Marking as INVALID. (We can cover supporting IE's extensions in another bug, if there isn't one filed already.)
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
if its as per the spec, then i agree
Thanks for attending to this report
You need to log in
before you can comment on or make changes to this bug.
Description
•