/    Sign up×
Community /Pin to ProfileBookmark

Select Objects — getting events during dropdown

I have a SELECT object containing a list of files. File stats (size, time/date, etc.) are displayed for the current selection.

[b]home.com[/b]
File Name…..: home.com
File Date…..: 04/27/2004
File Size…..: 1,200
Subdirectory..: c:mySubdirtmp

<select>
<option>home.com
<option>clrscrn.com
<option>testkbd.com

</select>

When the user clicks the SELECT and the drop-down list of files is displayed, I want to trap the currently-highlighted item as the selection bar is moved through the list of possible selections, so I can update the file stats.

My 1st question is this:
[b]Is there a way to do an attachEvent() to the SELECT or to each OPTION (or to the FIRN, or whatever) so that I can get control as the user moves through the drop-down list?[/b]

If the answer to #1 is yes, then:
[B]What event would be trapped to obtain control?[/b]

Thanks so much in advance for any assistance/suggestions/guidance you can supply!

  • john ferguson, kansas city
  • to post a comment
    JavaScript

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @Khalid_AliMay 03.2004 — below is the w3c docu fragment for html element option

    <!ELEMENT OPTION - O (#PCDATA) -- selectable choice -->

    <!ATTLIST OPTION

    %attrs; -- %coreattrs, %i18n, %events --

    selected (selected) #IMPLIED

    disabled (disabled) #IMPLIED -- unavailable in this context --

    label %Text; #IMPLIED -- for use in hierarchical menus --

    value CDATA #IMPLIED -- defaults to element content --
    >

    you can not add any events directly to the options..
    ×

    Success!

    Help @raddog spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.5,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...