A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Murach's Java Servlets and JSP
this week in the
How to preselect a value in drop down ?
Joined: Feb 13, 2010
Dec 19, 2010 07:33:38
I am using Struts 1.3 and using following code to display drop down in one tab on my page ..
<html:select property="acctId" styleId="acctId" style="width:180px"> <html:option value="0">--None--</html:option> <html:options collection="acctList" labelProperty="value" property="id" /> </html:select>
There is one more such drop down on home page.
If user selects an option on home page and navigates to this tab then the same value should be preselected in this drop down ..
Please let me know how this can be handled ..
Bhagat Singh Rawat
Joined: Apr 04, 2009
Dec 19, 2010 14:25:40
Brainbench Java 2.0 Fundamentals, J2EE 1.4
Joined: Aug 03, 2008
Dec 20, 2010 06:20:18
You can also use the
tag to preselect any option...
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
I agree. Here's the link:
subject: How to preselect a value in drop down ?
Displaying Data From Different Tables in .jsp
enable/disable drop down
Tooltip on html:select
How to select a value in the drop down list with value getting from database?
Using SELECTED in an html:option tag
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014