Help with default selected html:select

T

tonyshirt

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.
 
A

Andrew Thompson

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>
 
T

tonyshirt

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top