Reputation: 6040
Given
<html:select property="loginPathId" style="width:190px">
<option value=""></option>
<html:optionsCollection property="loginPath" value="id" label="displayName"/>
</html:select>
Right now, it is a dropdown list with an empty default value. how do i populate it by default with say option value=1
?
Can this be done without using jQuery, and only with struts, java, javascript and html?
Upvotes: 1
Views: 2424
Reputation: 40348
<html:select property="status" value="...your status choise here...">
<html:optionsCollection name="loginPath" label="displayName" value="id" />
</html:select>
Upvotes: 0
Reputation: 104795
Inside the option you wanted selected:
<option selected="selected">value</option>
Upvotes: 2