• JSP默认选中下拉框的某一项


     注意<c:if>标签要写在<option>标签里面

    <select id="salesInventory_${s.index}" style=" 98%;">
    						<option value="">-请选择-</option>
    				        <c:forEach var="salesInventory" items="${salesInventoryList}">
    							<option value="${salesInventory.propertyCode}"
    				        		<c:if test="${salesInventory.propertyValue=='备件库存'}">selected</c:if>>${salesInventory.propertyValue}  
    				        	</option>
    						</c:forEach>
    				    </select>
    
    <td style="vertical-align:middle" align="right" width="10%"><label><span class="redmark">*</span>所属客户:</label></td>
    								<td style="vertical-align:middle" align="left" width="20%">
    									<select name="baseBusinessOrg" style="95%">
    										<option value="">--请选择--</option>
    										<c:forEach var="customerBelonged" items="${customerBelongedList}">
    											<option value="${customerBelonged.id}"
    												<c:if test="${warehouseInfo.baseBusinessOrg.id==customerBelonged.id}"> selected</c:if>><c:out value="${customerBelonged.customerName}"/></option>
    										</c:forEach>
    									</select>
    								</td>
    
  • 相关阅读:
    AOD.net
    C# Eval()和Bind()
    .Net使用微軟自帶的用戶驗證和登錄授權
    .Net面試4套
    .Net面試題
    MVC开发模式
    .Net自帶Ajax和GridView
    HTML系列(HTMl+CSS+JavaScript+Jquery)--un
    .Net母版页
    .NetDOM操作--un
  • 原文地址:https://www.cnblogs.com/kyxyes/p/3558350.html
Copyright © 2020-2023  润新知