This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Select   ..... Option  Problem.. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Select   ..... Option  Problem.." Watch "Select   ..... Option  Problem.." New topic
Author

Select ..... Option Problem..

Manu Dhanda
Greenhorn

Joined: Jan 28, 2006
Posts: 23
Hii All,

I want to select an option among the few by VALUE.

For Example-


Now suppose I have the value "2" with me and now I want to select the option by this value.

How can I do that??
Help me out, am trying to work out this problem with my code here, but couldn't get through it yet.

Thanks.
Manu.


"Books are as useful to a stupid person <br />As a mirror is useful to a blind person." <br /> <br />Chanakya quotes (Indian politician, strategist and writer, 350 BC-275BC)
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15362
    
    6
have you tried

document.forms[0].selectName.value = "2";

Eric
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Select ..... Option Problem..
 
Similar Threads
How to show selected value, and name of list menu
Create a box
Inline Form Validation
Any Suggestion about a small project?
Javascript Dynamic Dropdown Box validation