Closed Bug 216556 Opened 22 years ago Closed 22 years ago

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

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 126379

People

(Reporter: tmelliot, Assigned: bugzilla)

Details

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.
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.
*** This bug has been marked as a duplicate of 126379 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.