我填充了下拉列表。当我选择国家/地区时,要显示下拉列表中的选定国家/地区值。假设在下拉列表中,我选择孟加拉国,我想显示 BD 。我在jsp中使用波纹管代码。
<spring:bind path="dialcode">
<div class="form-group row">
<select class="form-control" id="countrycode"
name="dialcode" path="dialcode">
<option data-tokens="ketchup mustard" value="">-Select Dial-</option>
<c:forEach var="country" items="${countryList}">
<c:choose>
<c:when
test="${country.dialcode == userInfoForm.dialcode}">
<!-- <option selected="selected" value="${compnayList.softcode}"><c:out
value="${compnayList.codDes}" /></option>-->
<option selected="selected"
data-tokens="ketchup mustard"
value="${country.dialcode}">${country.dialcode}
</option>
</c:when>
<c:otherwise>
<option data-tokens="ketchup mustard"
value="${country.dialcode}" >${country.countryname}-${country.dialcode}
</option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
<span class="error text-danger">${dialcode}</span>
</div>
</spring:bind>