Closed Bug 287834 Opened 20 years ago Closed 20 years ago

onchange event is not fired when keying through a <select> using up/down arrows

Categories

(Firefox :: Keyboard Navigation, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bugzilla, Assigned: aaronlev)

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

I have a drop down that I allow the user to select a download format for an
image.  When the user selects an option, I update a few text nodes to show some
details about that download format (ie. JPEG vs. TIFF, CMYK vs. RGB, etc.). 
When I click on a different option, the text is properly updated through the JS
call, however, when I then use the up/down arrow keys to move through the
different options, it does not work anymore.

There is a simple workaround, obviously only use the mouse, but, a web developer
(as myself) should not have to rely on the user knowing this.  As well, I do not
think it should be up to me to catch an onkeydown/onkeypress to determine
whether it has changed or not, although it would seem to be a fairly simple
workaround.

Reproducible: Always

Steps to Reproduce:
1. Create page using sample code below.
2. Using the mouse, select an option in the dropdown.  A javascript popup should
alert you to the option you have selected.
3. With the <select> focused, use the up/down arrow keys to change to a
different option.  No popup shows up.

Actual Results:  
The onchange event does not seem to be fired after up/down changes the selection.

Expected Results:  
The onchange event should be fired whether it is changed by the mouse (clicking
on it) or a user pressing up/down.

    <h4>SELECT DOWNLOAD FORMAT</h4>
    <select id="downloadforamt" style="width: 270px;" onchange="alert('You have
selected the download format: ' + this.value);">
        <option value="">Please Select an Image Format</option>
        <option value="WEBGIF">Web GIF</option>
        <option value="WEB">Web JPEG</option>
        <option value="MEDTIFF">Medium Quality TIFF</option>
        <option value="MEDTIFF_GRAY">Medium Quality TIFF (Grayscale)</option>
    </select>

    <div id="pickupdesc" style="display: block;">
    <table class="table">
     <tbody>
      <tr>
        <td><strong>Format:</strong></td>
	    <td rowspan="2">&nbsp;&nbsp;</td>
        <td id="idFormat">GIF (RGB)</td>
      </tr>
      <tr>
        <td><strong>Resolution:</strong></td>
        <td id="idRes">200x200 (72 DPI)</td>
      </tr>
     </tbody>
    </table>
Sorry, my bad!!  I didn't realize that when I remove the focus from the select
that the onchange event is then fired.  Sorry, I feel a little silly... ;)
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
See also bug 126379.
You need to log in before you can comment on or make changes to this bug.