struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: how to get both values and text for <html:select/> option?
Date Tue, 15 Jul 2003 18:23:36 GMT
Only the string in the value attribute gets submitted to the server so
there is no way of retrieving the text the user sees as the option.

David

--- "Jung, Eric (Contractor)" <ejung@russellmellon.com> wrote:
> Hi,
> I've searched the FAQ and the archives, but can't find an answer to this
> question. I'm know it's been asked before, but part of my problem seems
> to be that the mail-archive search tool doesn't like colons or < >
> characters (so searching for <html:select> becomes difficult). Try as I
> may, I'm not able to find an answer.
> 
> I'm trying to get both the values and the text of the selected
> <html:options/> in an <html:select/>. It appears that right now I'm only
> getting one (the values, I think, but not the text) in my ActionForm's
> String array:
> 
>   public class MappingForm extends ActionForm {
>     private String [] columns;
>     //getColumns() and setColumns() removed for brevity
>     ...
>   }
> 
> <html:select multiple="true" property="columns">
>   <html:option value="a">one</html:option>
>   <html:option value="b">two</html:option>
> </html:select>
> 
> In other words, I'm only getting "a" and "b" in my array. However, I'd
> like to have another String array, or a 2-dimensional String array, that
> receives both "a", "one", and "b", "two".
> 
> Any help would be greatly appreciated. Thanks in advance.
> 
> Sincerely,
> 
> Eric H. Jung
> Software Engineer
> Russell/Mellon Analytical Services
> 1-617-382-1373
> Everett, MA, USA
> ejung@russellmellon.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message