This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Select   ..... Option  Problem.." Watch "Select   ..... Option  Problem.." New topic

Select ..... Option Problem..

Manu Dhanda

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.


"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

Joined: Nov 08, 2001
Posts: 15385
have you tried

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

I agree. Here's the link:
subject: Select ..... Option Problem..
It's not a secret anymore!