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