Help with default selected html:select

Discussion in 'Java' started by tonyshirt@hotmail.com, Oct 5, 2005.

  1. Guest

    I'm new to struts and I'm hoping someone can help.

    I have a html:select statement on a action form.

    <html:select property="dataSelect"
    onchange="this.form.loadButtonJavaScript.value='true';
    this.form.submit();">
    <html:eek:ptions collection="dataCollection" property="id"
    labelProperty="name"/>
    </html:select>

    I want to be able to select an option other than the first one in
    dataCollection.
     
    , Oct 5, 2005
    #1
    1. Advertising

  2. wrote:

    > I want to be able to select an option other than the first one in
    > dataCollection.


    <select>
    <option value"Cat">
    <option value="Dog" SELECTED>
    <option value="Canary">
    </select>
     
    Andrew Thompson, Oct 5, 2005
    #2
    1. Advertising

  3. Guest

    Can I do it in context of datacollection? For instance Can I iterate
    through the collection assigned to the html:eek:ptions tag and select the
    appropriate option? How do I reference the option array?

    I tried options.selected and .value. i just got errors.
     
    , Oct 5, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J. Hall
    Replies:
    2
    Views:
    1,071
    Jeff Thies
    Apr 21, 2004
  2. Iain
    Replies:
    3
    Views:
    936
  3. mldardy
    Replies:
    0
    Views:
    968
    mldardy
    Sep 28, 2010
  4. palmiere
    Replies:
    1
    Views:
    409
    Erwin Moller
    Feb 9, 2004
  5. WebRaster
    Replies:
    1
    Views:
    269
    Francisco Spaeth
    Oct 26, 2005
Loading...

Share This Page