Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Help with default selected html:select

Reply
Thread Tools

Help with default selected html:select

 
 
tonyshirt@hotmail.com
Guest
Posts: n/a
 
      10-04-2005
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='tr ue';
this.form.submit();">
<htmlptions collection="dataCollection" property="id"
labelProperty="name"/>
</html:select>

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

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      10-04-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) 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>
 
Reply With Quote
 
 
 
 
tonyshirt@hotmail.com
Guest
Posts: n/a
 
      10-04-2005
Can I do it in context of datacollection? For instance Can I iterate
through the collection assigned to the htmlptions tag and select the
appropriate option? How do I reference the option array?

I tried options[i].selected and .value. i just got errors.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help to fill textboxes from a selected item in datagrid-selected index changed. mldardy ASP .Net 0 09-28-2010 02:59 PM
selected=selected in the center of option list John HTML 5 03-01-2010 08:30 PM
Selected ListItem in DropDownList does not appear selected Nathan Sokalski ASP .Net Web Controls 0 10-05-2008 10:29 PM
Selected ListItem in DropDownList does not appear selected Nathan Sokalski ASP .Net 0 10-05-2008 10:29 PM
DropDownList 2 always returns Selected = 0 for all items - even selected item Iain ASP .Net 3 12-11-2006 11:07 AM



Advertisments