Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
help on html:select for default value
Joined: Apr 04, 2002
Jul 28, 2006 11:00:00
I have a dropdown list getting from a collection in database,
I need to set one of the value in this dropdown as default, how do i do it via STruts tag;
Many thanks for your help.
ps: in hard code select, just added "selected" to one to the option, but not sure how to approach this
<html:select property="regionCode"> <logic:iterate name="regionCodeSelections" id="row" type="CodesResult"> <html :-o ption value="<%=row.getCode()%>"><%=row.getCode()%> </html :-o ption> </logic:iterate> </html:select>
Joined: Feb 15, 2005
Jul 28, 2006 12:41:00
Sometime prior to this portion of the
code (preferably in your Action class), simply set the value of the regionCode property in your form bean to the value theat you want as the default:
Struts automatically selects the option that matches the value of the property specified in the <html:select> tag.
Don't get me started about those stupid
subject: help on html:select for default value
how to set option to default ?
Help me regarding select value in html:select...
How can I add more text input base on users selection
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013