js方法

function ViewTbx(obj)
          {
              for(var i=0 ;i<4;i++)
              {
                  var div1=document.getElementById("div1");
                  var textb= div1.getElementsByTagName("INPUT")[i];
                  textb.style.display = "none";
                  textb.value="";
              }
              var ddl=obj.options[obj.selectedIndex].value;
              for(var i=0 ;i<(parseInt(ddl));i++)
              {
                  div1=document.getElementById("div1");
                  textb= div1.getElementsByTagName("INPUT")[i];
                  textb.style.display = "inline";
              }
          }

 

 <table class="outer2" width="100%" id = "div1"  cellpadding="0" cellspacing="0">
                    <tr>       
                    <td width="300">
                        <asp:Literal ID="Literal5" runat="server" Text="選擇月結帳次數" meta:resourcekey="Literal5Resource1"></asp:Literal>
                  
                        <asp:DropDownList  ID="DropDownList1" onchange="ViewTbx(this);" runat="server" Width="107px">
                            <asp:ListItem Value="0" Selected="True">請選擇</asp:ListItem>
                            <asp:ListItem Value="1">1次</asp:ListItem>
                            <asp:ListItem Value="2">2次</asp:ListItem>
                            <asp:ListItem Value="3">3次</asp:ListItem>
                            <asp:ListItem Value="4">4次</asp:ListItem>
                        </asp:DropDownList>
                      </td>
                      <td >
                            <asp:Literal ID="Literal8" runat="server" Text="由小到大填寫月結帳日:" meta:resourcekey="Literal5Resource1"></asp:Literal>
                      <asp:TextBox ID="TextBox1"  runat="server" Width="80px" CssClass="displaynone"></asp:TextBox>
                       <asp:TextBox ID="TextBox2"   runat="server" Width="80px" CssClass="displaynone"></asp:TextBox>
                         <asp:TextBox ID="TextBox3"  runat="server" Width="80px" CssClass="displaynone"></asp:TextBox>
                        <asp:TextBox ID="TextBox4"  runat="server" Width="80px" CssClass="displaynone"></asp:TextBox>
                         &nbsp;&nbsp;&nbsp;
                        <asp:Button ID="Button1" runat="server" Width="101px" click="check();" Text="產生結帳期間表" meta:resourcekey="Button1Resource1" OnClick="Button1_Click"></asp:Button>
                     </tr>
                    </table>       

posted @ 2008-09-04 10:35  XGU_Winner  阅读(203)  评论(0编辑  收藏  举报