大家早上好,我有一段对我来说看起来很重的代码,我想用轻量级的代码。我的任务是使用两个下拉框选择州和城市。我需要根据州下拉框更改城市下拉框,请帮助我
这是我的代码:::
<fieldset>
<legend>Compare To</legend>
<span>state</span><select id="locationId" name="locationId">
<option value="0" <c:if test="${loc.location eq '0'}">selected="selected"</c:if>>All Locations</option>
<c:forEach items="${locationDetailsList}" var="locationDetails">
<option value="${locationDetails.locationId}" <c:if test="${loc.locationId2 eq locationDetails.locationId}">
selected="selected"</c:if>>${locationDetails.locationName}</option>
</c:forEach></select>
<span>area</span>
<select id="area" name="area">
<option value="0" <c:if test="${locationId eq '0'}">selected="selected"</c:if>>All Locations</option>
<option value="1" <c:if test="${locationId ge '1'}">selected="selected"</c:if>>Hyderabad</option>
<option value="1" <c:if test="${locationId ge '1'}">selected="selected"</c:if>>Vizag</option>
</select>
</fieldset>
提前谢谢亲爱的朋友们...