JSP默認選中下拉框的某一項


 

 注意<c:if>標簽要寫在<option>標簽里面

<select id="salesInventory_${s.index}" style="width: 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="width: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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM