File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes html:select and option Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:select and option" Watch "html:select and option" New topic
Author

html:select and option

geofrey pony
Greenhorn

Joined: Jul 18, 2006
Posts: 15
I want to combine html:select with normal <option> tag and not html ption or html ptions or html ptionsCollection etc.

e.g.
<html:select name="animalForm" property="animal" size="1" styleClass="dataInputField" styleId="5" onchange="animalChanged(this.value)">
<option value="lion">lion</option>
<option value="tiger">tiger</option>
<option value="ant">ant</option>
</select>

when selected value in the drop down is changed, the correct value is retreived at the server side however when the page reloads the value selected is the first value in the drop down and not the value that was selected by the user.

Is it that html:select must be combined with html ption or html ptions or html ptionsCollection and cannot be combined with <option> tag for this feature??

Thanks in advance
geofrey pony
Greenhorn

Joined: Jul 18, 2006
Posts: 15
Thanks everyone. My problem is sorted if I use the simple version of
htmlption
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:select and option
 
Similar Threads
Help me regarding select value in html:select...
Regarding html:select kind of URGENT
Can struts repopulate collection from html:select upon submit?
how to fill a combobox with values from objects in an ArrayList...
drop down list validation