Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:select and option

 
geofrey pony
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everyone. My problem is sorted if I use the simple version of
htmlption
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic