File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 15376
have you tried

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

I agree. Here's the link:
subject: Select ..... Option Problem..