<pre name="code" class="html"><tbody>
<c:forEach items="${compInfo}" var="comp" varStatus ="status">
<tr>
<td>
<select name="costEval_${comp.componentID}" id="costEval_${status.index}">
<option value="10" <c:if test="${comp.szCostEval==10}">selected="true"</c:if>>高</option>
<option value="3" <c:if test="${comp.szCostEval==3}">selected="true"</c:if>>中</option>
<option value="1" <c:if test="${comp.szCostEval==1}">selected="true"</c:if>>低</option>
<option value="0" <c:if test="${comp.szCostEval==0}">selected="true"</c:if>>未定义</option>
</select>
</td>
</tr>
<c:if test="${status.last}">
<input type="hidden" id="compCount" name="compCount" value="${status.count}" />
</c:if>
</c:forEach>
</tbody>
select 控件选择值验证
<script type="text/javascript">
function checkInput(){
for(i=0; i<= $("#compCount").val(); i++ ){
if(0 == $("#costEval_"+i).val()){
alert("请输选择。。。。!");
return false;
}
}
return true;
}
</script>