Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #14109
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Accessing a <select> <option> ? |
| Date | Wed, 23 May 2012 13:42:55 -0600 |
| Lines | 35 |
| Message-ID | <a24su6Fd3rU1@mid.individual.net> (permalink) |
| References | <a2273uFft7U1@mid.individual.net> <4fbd37ba$0$21484$ba4acef3@reader.news.orange.fr> |
| X-Trace | individual.net cGnlq2tkgJbPMJqaEt5i+Aw+7Qa/fZyg6Xsa/aBZ5dKs3uFXPtmxSGLyNhS3KaEFCx |
| Cancel-Lock | sha1:mUZ7hN91Le2WxpxLTMvQy4Nbt1k= |
| X-Priority | 3 |
| X-MSMail-Priority | Normal |
| X-Newsreader | Microsoft Outlook Express 6.00.2900.5931 |
| X-MimeOLE | Produced By Microsoft MimeOLE V6.00.2900.6157 |
| X-RFC2646 | Format=Flowed; Response |
| Xref | csiph.com comp.lang.javascript:14109 |
Show key headers only | View raw
Stephane a dit:
>
> I thinck you can't attribute an onclick to an option
> the onclick is for the all select (as 'onchange' for instance)
>
>
> so I think you must use something like :
>
> <select onchange="myFunction(this)">
> <option>
> <option>
> ...
>
> function myFunction(what) {
> var i = what.selectedIndex,
> k = what.options[i].value;
> alert(k);
> switch(i) {
> case 0: doThat(); break;
> case 3: doThis(); break;
> }
> }
Hi Stephane:
Yes, I'm doing the above now successfully, but thanks for your response
!
(btw, I'm posting another question in a few minutes re: auto-scrolling
of <option>s in a <select> list.)
-Mel Smith
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Accessing a <select> <option> ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-22 13:18 -0600
Re: Accessing a <select> <option> ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-22 13:43 -0600
Re: Accessing a <select> <option> ? Matt McDonald <matt@fortybelow.ca> - 2012-05-22 14:43 -0600
Re: Accessing a <select> <option> ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-22 15:09 -0600
Re: Accessing a <select> <option> ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-22 20:26 -0600
Re: Accessing a <select> <option> ? SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-05-23 21:17 +0200
Re: Accessing a <select> <option> ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-23 13:42 -0600
Re: Accessing a <select> <option> ? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-23 21:17 +0000
csiph-web