JSP:
<label id="ShowPosesConfig" >Configuration</label><br/>
<div id="DivPosesConfig" class="DivPosesConfig" style="display:none">
enter code here
<form action="<%=request.getContextPath()%>/UpdateServlet" method="post" name="nomPosInfo" id="posesAction">
<select onchange="return checkSelect();">
<option value="-1">Please choose ...</option>
<% for(PosesBean poses : posesMap.values()){%>
<option <%=poses.getPosID()== selectedId ? "selected" : ""%> value="<%=poses.getPosID()%>"><%=poses.getPosCode()+ " "%><%=poses.getAddressBG()%></option>
<%}%>
</select><br/><br/><br/>
<%if(selectedId > -1){%>
<label>Email:</label> <input type="text" id="emailPos" name="email" value="<%=selectedId == -1 ? "" : posesMap.get(selectedId).getEmail()%>" size="45"/><br/><br/>
<label>Phone:</label> <input type="text" id="phonePos" name="phone" value="<%=selectedId == -1 ? "" : posesMap.get(selectedId).getPhone()%>" size="45" /><br/><br/>
<input type="submit" style="margin-left:125px" value="Save changes" onclick="return checkRadio();"/><br/><br/>
<hr class="order"/><br/>
<%}%>
</form>
</div>
JavaScript的:
$(document).ready(function(){
$('#ShowPosesConfig').click(function(){
$('.DivPosesConfig').toggle("fast");
});
});