question about struts options tag

hidoes anyone know how to get the value of the labelProperty in action class. i was hoping to get both the value user selects and the display value. how do i access it? thanks
[196 byte] By [yu169409a] at [2007-11-26 15:09:21]
# 1

When you submit a form, only the value of a select control gets submitted. Not the displayed item. That is a limitation of the HTML control rather than struts.

You could always have an onclick event on the select box that copies the "display value" into a hidden field whenever you select an item. That way you could get id AND value.

Or store a list/map at the server end (in session scope) and use the value to look up the display string.

Hope this helps,

evnafets

evnafetsa at 2007-7-8 8:59:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
thanks. the hidden value should do it.
yu169409a at 2007-7-8 8:59:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Can anyone print the onclick code for this? Thanks in advance.
RealDeal44a at 2007-7-8 8:59:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...