We have a box.This list will show different states in USA. I want the state "LA" to be as preselected. But I do not know the position of "LA" in the list. It can change. To do this, we use the following script.
<select id="state" name="state" title="State" class="js_required prompt_text grid_2" tabindex="5">
<option>State</option>
<s:iterator value="@com.homeservices.action.utils.StateCode@values()">
<option value="<s:property/>"><s:property/></option>
</s:iterator>
</select>
var @ com.homeservices.action.utils.StateCode @values () provides a list of values:
AA
AE
AK
CA
CT
IL
LA
MA
MD
...... etc.
Can someone suggest how to make LA as a preselected state.
source
share