It's not a secret anymore!*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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