支撑杆中的预选值 tag?
-
20-08-2019 - |
题
我有这个支柱标签:
<s:select name="country.id"
list="countries"
listValue="name"
listKey="id"
headerValue="Select Country"
headerKey=""
label="Country" />
输出以下HTML代码:
<select name="country.id" tabindex="12" id="registration_country">
<option value="">Select Country</option>
<option value="1">United States</option>
<option value="2">Afghanistan</option>
<option value="3">Albania</option>
<option value="4">Algeria</option>
...
<option value="192">Zambia</option>
<option value="193">Zimbabwe</option>
</select>
我该如何指定我想要的“阿尔巴尼亚”要在列表中预选?
解决方案
使用 value
属性 s:select
标签:
<s:select name="country.id"
list="countries"
listValue="name"
listKey="id"
headerValue="Select Country"
headerKey=""
label="Country"
value="3" />
其他提示
尝试这个:
headerKey="3"
不隶属于 StackOverflow