新增弹窗:这里需要根据所选的“供方类别”来判断是否隐藏“工号”的文本框。
<div align="center" style=" display:none; " id="divnew">
<table style="border: 1px solid #7DBEFF">
<tr>
<td align="right" >供方类别:</td>
<td align="left">
<asp:DropDownList ID="ddl_supplierType" runat="server" OnChange ="sup()" >
<asp:ListItem Value="" Text="" />
<asp:ListItem Value="Z001" Text="供方" />
<asp:ListItem Value="Z002" Text="关联方" />
<asp:ListItem Value="Z003" Text="个人" />
</asp:DropDownList>
<a style="color: #FF0000">*</a>
</td>
</tr>
<tr>
<td align="right" id="txt_gh">工号:</td>
<td align="left" id="txt_ghtd">
<input type="text" id="Txt_newgfbh" style="width:200px"/>
<a style="color: #FF0000">*</a>
</td>
</tr>
<tr><td>.</td></tr>
<tr>
<td colspan="2" align="center">
<input type="button" id="Btn_newsave" value="保存" />
<input type="button" id="Btn_newcancel" value="取消" onclick="closes()" />
</td>
</tr>
</table>
</div>
JavaScript部分:
<script type="text/javascript">
function sup()
{
if ($("#<%=ddl_supplierType.ClientID %>").val() == "Z001")
{
document.getElementById("txt_gh").style.display = "none";
document.getElementById("txt_ghtd").style.display = "none";
}
if ($("#<%=ddl_supplierType.ClientID %>").val() == "Z002")
{
document.getElementById("txt_gh").style.display = "none";
document.getElementById("txt_ghtd").style.display = "none";
}
if ($("#<%=ddl_supplierType.ClientID %>").val() == "Z003")
{
document.getElementById("txt_gh").style.display = "";
document.getElementById("txt_ghtd").style.display = "";
}
}
</script>