I want an item selected...  I just don't want it selected like that, i.e.
selected="selected".  I don't understand why it's generated this way.  Why
not just selected?

--Michael Marrotte

-----Original Message-----
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 5:19 PM
To: Struts Users Mailing List
Subject: Re: <html:select> selected="selected" ?


It's a feature =:o)

If you don't want one of the items selected, then there's no reason to
use the option tags.

The idea is that it is suppose to select the current state.

It may be that you need to be sure payer.state is set to "" at the
beginning.

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services



Michael Marrotte wrote:
>
> I'm trying to generate:
>
> <select name="state">
>               <option value=""></option>
>               <option value="AL">AL</option>
>               <option value="AK">AK</option>
>               <option value="AS">AS</option>
>               <option value="AZ">AZ</option>
> ...
> So, I use the following syntax:
>
>           <html:select property="state" name="payer" >
>               <html:option value=""></html:option>
>               <html:option value="AL">AL</html:option>
>               <html:option value="AK">AK</html:option>
>               <html:option value="AS">AS</html:option>
>               <html:option value="AZ">AZ</html:option>
> ...
>
> But, I don't get the desired result, instead I get (e.g. when
> payer.getState()=="AK):
>
>          <select name="state"><option value=""></option>
>               <option value="AL">AL</option>
>               <option value="AK"selected="selected">AK</option>
>               <option value="AS">AS</option>
>               <option value="AZ">AZ</option>
>
> Does anyone know why the HTML is generated this way?  Is there a way to
get
> my desired results, from above?
>
> Any help is greatly appreciated.
>
> Thanks,
>
> --Michael Marrotte

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to