Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dropdown list of numbers

0 views
Skip to first unread message

RICK

unread,
May 15, 2008, 4:45:00 PM5/15/08
to
I am trying to create a drop down list of number from 1 -2000.

Is there a better way to do this other than:

<option value="2">2</option>
<option value="3">3</option>
.
.
.
.
<option value="2000">2000</option>

Rick

Sylvain SF

unread,
May 15, 2008, 5:16:38 PM5/15/08
to
RICK wrote on 15/05/2008 22:45:
> I am trying to create a drop down list of number from 1 -2000.
>
> Is there a better way to do this other than:
>
> <option value="1">1</option>

> .
> <option value="2000">2000</option>

yes using JScript !

var select = document.getElementById(selectTag);
for (var i = 1; i <= 2000; ++i){
var option = document.createElement("OPTION");
option.text = "" + i;
option.value = i;
select.add(option, null);
}

but do you really think that such select item will be usable ??
do your users will actually accept to scroll thru such list ?

Sylvain.

0 new messages