Hi,

Set the location property in your from to the default value you wan to select, then the tag will automatically select the option that matches this value

Thanks,

Nuwan


----- Original Message ----- From: "Chirag" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Sunday, May 06, 2007 9:23 AM
Subject: How to set default value in the html:select which is populated with html:optionsCollection tag?


I am a little newbie type in Struts

I already have the following code
<html:select  styleClass="input" property="location">
<html:option value="0">All</html:option>
<html:optionsCollection name="advertsForm"
property="locations" label="locationDesc"
value="locationId" />
</html:select>

Now I want to modify this code in such a way that it
selects a default value .

How to do that

Thanks in advance

CSJakharia

Subscribe to bermudaEmail: [input] [input] Browse Archives at groups.google.com



____________________________________________________________________________________
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367

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



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

Reply via email to