File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
how to auto select the value in drop down list
Joined: Jul 24, 2004
Mar 30, 2005 02:28:00
i have ondrop down list and i want to retrieve some value from database and then want that value to be selected in that drop down list .
plz tell me that how to do that because it is urgent...
Joined: Nov 08, 2001
Mar 30, 2005 07:28:00
Add the selected atttribute in the option tag when you are creating the drop down on the server
document.FormName.elementName.selectedIndex = 2;
If you do not know where it is, you need to loop through the options until it matches then select it.
I agree. Here's the link:
subject: how to auto select the value in drop down list
dependent drop down list
How to automatically change the page contents with change in drop down list option selection
Auto generate drop down list
problem with struts2 drop down
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015