样式显示=块?

时间:2014-04-23 13:21:17

标签: javascript jquery jsp

我有非常奇怪的情况:)我的问题是当打开页面时用户只看到dropdrown列表。选择选项后所有div隐藏。可以在提交后选择div显示:)

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>&nbsp;&nbsp;<input type="text" id="emailPos" name="email" value="<%=selectedId == -1 ? "" : posesMap.get(selectedId).getEmail()%>"  size="45"/><br/><br/>

            <label>Phone:</label>&nbsp;<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");
        });
 });

0 个答案:

没有答案