Use the 'value' attribute to make the selection. For example assume you
have a dropdown of countries and one entry is 'United States' the code
below would select 'United States'.
<html:select
property="country" value="United States">
...
</html:select>
-----Original Message-----
From: [EMAIL PROTECTED] at INTERNET
[mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+20INTERNET
@alltel.com]
Sent: Wednesday, July 18, 2001 10:38 AM
To: Clark, Joe; [EMAIL PROTECTED] at INTERNET
Subject: html:select/options
Is there a way to dictate which "option" in a collection is initially
set
as
"selected" when the page is rendered?
ex
<html:options collection="Roles" property="name" /
For example, I have a collection of projects that are rendered by the
<html:options tag. I also have some java script which updates a
project
description box when the selection is changed. The problem is
when the page
is first rendered, the two don't always match up. I initialize the
description box to the first item in the collection, but the
select doesn't
always choose the first item.
Thanks
D