下拉框回显

性别

 <select class="form-control" name="sex" id="sex">
                                    <%--<option>性别...</option>--%>
                                    <option value="0" <c:if test="${talentInfo.sex == '0'}">selected</c:if> >男</option>
                                    <option value="1" <c:if test="${talentInfo.sex == '1'}">selected</c:if> >女</option>

                                </select>

 

遍历的下拉框           

   <select class="form-control" id="certificaType" name="certificaType">
                                    <%--<option>证件类型...</option>--%>
                                    <c:choose>
                                        <c:when test="${!empty talentInfo}">
                                            <c:forEach var="c" items="${certificaTypeList }">
                                                <option value="${c.dictCode }" <c:if test="${talentInfo.certificaType eq c.dictCode}">selected="selected"</c:if>>
                                                        ${c.dictName }</option>
                                            </c:forEach>
                                        </c:when>
                                        <c:otherwise>
                                            <c:forEach var="c" items="${certificaTypeList }">
                                                <option value="${c.dictCode }"> ${c.dictName }</option>
                                            </c:forEach>
                                        </c:otherwise>
                                    </c:choose>
                                </select>

 

posted @ 2016-06-30 12:42  夏末、初秋  阅读(314)  评论(0编辑  收藏  举报