onchange event does not fire for select element when using the keyboard to change the value

RESOLVED DUPLICATE of bug 126379

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 126379
14 years ago
14 years ago

People

(Reporter: Ted Elliott, Assigned: Blake Ross)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6

The onchange event does not fire for a select element when using either the up
and down arrow keys, or typing the first letter of an option in the dropdown to
change the current value.



Reproducible: Always

Steps to Reproduce:
Enter the following code in an html page:
<select name="exampleSelect" onchange="alert('New Value=' + this.value)">
   <option value="aValue">A Value</option>
   <option value="bValue">B Value</option>
   <option value="cValue">C Value</option>
</select>

Using the mouse to select different elements in the dropdown, you should see the 
the alert message when you select a different item.  If you set focus to the
dropdown and then use either the up or down arrows keys or type in 'A', 'B', or
'C'to select different elements, the alert message does not show.
Actual Results:  
Alert message shows when you use the mouse to select a different option, but not
when using the keyboard.

Expected Results:  
Behavior should be the same for using the mouse or the keyboard.
(Reporter)

Comment 1

14 years ago
After first entering the bug, I learned that when you use the keyboard to change
the selected option, if the dropdown loses focus the onchange event will then
fire.  But that is not correct behavior, the onchange should fire as soon as the
value changes when using the keyboard, ie. when clicking down on the down arrow
key once, the event should fire.

Comment 2

14 years ago

*** This bug has been marked as a duplicate of 126379 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.