Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Internet & the Web   »   How to set the selection of a combo list

 
Question Tools Search this Question Display Modes
Question
 
 
#1  
Old May 22, 2006, 02:02 AM
xuanmanh's Avatar
xuanmanh
New Member
xuanmanh is offline
 
Join Date: Aug 2005
Location: Hanoi, Vietnam
Posts: 25
xuanmanh See this member's comment history on his/her Profile page.
Send a message via AIM to xuanmanh Send a message via Yahoo to xuanmanh
How to set the selection of a combo list

Does anyone know wherer there is a javascript method to set the selection of a combo list?

Reply With Quote
 
     

Answers
 
 
Old May 22, 2006, 03:49 AM   #2  
LTheobald
Ultra Member
LTheobald is offline
 
LTheobald's Avatar
 
Join Date: Feb 2004
Location: Cambridge, UK
Posts: 1,047
LTheobald See this member's comment history on his/her Profile page.LTheobald See this member's comment history on his/her Profile page.
Call LTheobald via Skype™ Send a message via MSN to LTheobald
Something like this maybe...

Imagine you had the following list:
Code:
<select name="testselect"> <option value="first">first option</option> <option value="second">second option</option> <option value="third">third option</option> </select>

You could then have a function like below:
Code:
function selectMe(val) { for (var i=0; i<document.all.testselect.length; i++) { if (document.all.testselect.options[i].value == val) { document.all.testselect.options[i].selected = true; } } }

So if you called selectMe with a value of "second", it would select the second option in the dropdown.

Is that what you meant?
  Reply With Quote
 
     
 
 
Old Jun 1, 2006, 03:59 AM   #3  
xuanmanh
New Member
xuanmanh is offline
 
xuanmanh's Avatar
 
Join Date: Aug 2005
Location: Hanoi, Vietnam
Posts: 25
xuanmanh See this member's comment history on his/her Profile page.
Send a message via AIM to xuanmanh Send a message via Yahoo to xuanmanh
Yes, absolultely right, My problem was solved so well. Thank you very much
  Reply With Quote
 
     


Question Tools Search this Question
Search this Question:

Advanced Search
Display Modes

 
Similar Sponsors

Similar Questions
Question Asker Topic Answers Last Post
AC/Heating Unit Combo HELP dgbrooks Heating & Air Conditioning 2 Aug 4, 2006 08:13 PM
Lite On Combo Drive Nez CD & DVD Drives 1 Jul 31, 2006 11:00 PM
Is there any way to do this 3-way combo? jamlove Electrical & Lighting 2 Oct 20, 2005 11:44 AM
Shoot-set and Quick-set Combo oldcoach Volleyball 2 Sep 21, 2005 05:54 AM
pipe selection caravelle Plumbing 2 Jun 17, 2004 04:36 AM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 05:41 PM.

Content Relevant URLs by vBSEO 3.0.0 RC6 © 2006, Crawlability, Inc.