Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Selecting Item in Drop Down List Box

Reply
Thread Tools

Selecting Item in Drop Down List Box

 
 
Andrew
Guest
Posts: n/a
 
      04-15-2005
I have a Drop Down List box of all of the days in the month (1-31). I
would like to set a specific item as selected when the user drops down
the box. For example, if the current value is 19, when the user drops
the box down, I would like the highlight to be on the 19 in the list,
how do I do this?

Thanks.

Jeff
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      04-15-2005
Andrew <(E-Mail Removed)> wrote:

>I have a Drop Down List box of all of the days in the month (1-31). I
>would like to set a specific item as selected when the user drops down
>the box. For example, if the current value is 19, when the user drops
>the box down, I would like the highlight to be on the 19 in the list,
>how do I do this?


With the selected attribute
http://www.w3.org/TR/html401/interac...#adef-selected

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      04-15-2005
Andrew <(E-Mail Removed)> wrote:

> I have a Drop Down List box of all of the days in the month (1-31).


Replace it by a text input field. Which one is faster, typing "30" or
scrolling down a menu and trying to choose "30" there? Not to mention
the possibility of being forced to _listen_ to "select one of the
following: one, two, three, four, five, ..." until you hear "thirtyone"
and realize that you just skipped "thirty" and don't know what to do.

> I would like to set a specific item as selected when the user
> drops down the box.


<input type="text" id="month" name="month" size="2" maxlength="2"
value="19">

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
retrive preselected value in second drop down list from the first drop down list weiwei ASP .Net 0 01-05-2007 07:29 PM
Selecting an item in a drop down list KatMagic ASP .Net 3 04-11-2006 07:25 PM
New to .NET, can I have one drop down box control the data of another drop down box using a database? SirPoonga ASP .Net 2 01-07-2005 10:44 PM
Re: Selecting an item in a drop down list Natty Gur ASP .Net 1 08-18-2003 02:40 PM
Selecting an item in a drop down list Bogdan Zamfir ASP .Net 2 08-17-2003 10:06 PM



Advertisments