---
title: "修改时修改页面的下拉框的值自动选择原有的"
author: "ware"
date: "2010-12-06T14:42:58Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2010-12-06T14:42:58Z"
id: 834529
url: "https://ware.iteye.com/blog/834529"
---

<td class="odd" width="15%">所属部门：</td>
					<td width="15%">
						<select name="CDeptId" id="CDeptId">
							<option value="0">------请选择------</option>
							<c:forEach items="${deptList}" var="d">
								<option value="${d.CDictionaryId }" id="dept${d.CDictionaryId}"  >${d.CDictionaryName }</option>
							</c:forEach>
						</select>
						<script>
							document.getElementById("dept${emp.CDeptId }").selected=true;
						</script>
					</td>