可选可填的DropDownList

-----onchange-------
-----this.parentNode.nextSibling.value=this.options[this.selectedIndex].text------

<div style="position:relative;width:110px;">
                           <span style="margin-left:35px;width:18px;overflow:hidden;float:right">
                             
                               <asp:DropDownList ID="ddlDockCode" runat="server" onChange="this.parentNode.nextSibling.value=this.options[this.selectedIndex].text" style="width:113px;margin-left:-92px" AppendDataBoundItems="True"  >
                              <asp:ListItem Text="SELECT" Value=""/>
                              </asp:DropDownList>  
                          </span>
                        <asp:TextBox ID="txtDockCode" runat="server" style="width:90px;position:absolute;left:0px;BACKGROUND-COLOR:#f6f6f6;" MaxLength="10"  />
                        </div>


nextSibling:获取文档树中与此元素位于同一级别的下一个元素。
parentNode:获取或设置作为当前节点的父节点的 SiteMapNode 对象。

*********************************************************************
---onclick---
---var child = document.all[event.srcElement.getAttribute("child",false)]----

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <script language="javascript">
        function show(c)
            {
                var child = document.all[event.srcElement.getAttribute("child",false)];
                if(child.style.display == "inline")
                    {
                        child.style.display = "none";
                        c.src = "../images/arrowup1.gif";
                    }
                else
                    {
                        child.style.display = "inline";
                        c.src = "../images/arrowdown1.gif";
                    }
            }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 357px" border="1">
          <tr>
                <td colspan="3" width="5%" style="height: 21px">
                    <img src="../images/arrowdown1.gif" id="openImages" οnclick="show(this)" child="tr1"/></td>
                <td colspan="1" style="height: 21px">
                </td>
            </tr>
            <tr id="tr1" runat="server" style=" display:inline">
                <td colspan="4" style="height: 21px">
                    test112345678</td>
            </tr>
            <tr>
                <td colspan="3" width="5%">
                    <img src="../images/arrowdown1.gif" id="closeImages" οnclick="show(this)" child="tr2" /></td>
                <td colspan="1" style="height: 21px">
                </td>
            </tr>
            <tr id="tr2" runat="server" style=" display:inline">
                <td colspan="4" >
                    test287654321</td>
            </tr>
        </table>
   
    </div>
    </form>
</body>
</html> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值