Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14124

Re: Scrolling Options in a <Select> List

From "Mel Smith" <med_cutout_syntel@aol.com>
Newsgroups comp.lang.javascript
Subject Re: Scrolling Options in a <Select> List
Date 2012-05-24 08:35 -0600
Message-ID <a26va1FjicU1@mid.individual.net> (permalink)
References <a24tjpFi1sU1@mid.individual.net> <4fbe3193$0$21488$ba4acef3@reader.news.orange.fr>

Show all headers | View raw


Sam a dit:

>  var mySelect = document.forms[0].elements['theSelector'];
> // empty the select
> mySelect.options.length = 0;
> // filling the select
> for (var i=0, n = myArray.length; i<n; i++)
>  {
>   var z = mySelect.options.length;
>   var o = new Option(myArray[i].text, myArray[i].value);
>   mySelect.options[z] = o;
>   // show/focus the new option
>   mySelect.selectedIndex = z;
>  }
>
>
> (note: my Fx jumps naturally to the last entry at the bottom)


Stephane:

    I'll try that out and let you know.

    In the meantime, I'll email you my current test page.

-Mel

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Scrolling Options in a <Select> List "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-23 13:54 -0600
  Re: Scrolling Options in a <Select> List "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-23 21:18 +0000
    Re: Scrolling Options in a <Select> List "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-23 17:15 -0600
      Re: Scrolling Options in a <Select> List "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-23 17:41 -0600
        Re: Scrolling Options in a <Select> List SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-05-24 14:27 +0200
          Re: Scrolling Options in a <Select> List "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-24 08:33 -0600
            Re: Scrolling Options in a <Select> List SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-05-24 17:15 +0200
        Re: Scrolling Options in a <Select> List "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-05-24 14:44 +0000
  Re: Scrolling Options in a <Select> List SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-05-24 15:03 +0200
    Re: Scrolling Options in a <Select> List "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-24 08:35 -0600
      Re: Scrolling Options in a <Select> List SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-05-24 17:14 +0200
        Re: Scrolling Options in a <Select> List "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-24 09:30 -0600
          Re: Scrolling Options in a <Select> List "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-24 10:16 -0600
            Re: Scrolling Options in a <Select> List "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-24 10:34 -0600
              Re: Scrolling Options in a <Select> List Scott Sauyet <scott.sauyet@gmail.com> - 2012-05-24 09:47 -0700
              Re: Scrolling Options in a <Select> List SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-05-25 10:05 +0200
                Re: Scrolling Options in a <Select> List "Mel Smith" <med_cutout_syntel@aol.com> - 2012-05-25 08:39 -0600

csiph-web