• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    javascript檢測。在回送

    發布: 2007-6-30 18:56 | 作者: admin | 來源: | 查看: 14次 | 進入軟件測試論壇討論

    領測軟件測試網
    <body MS_POSITIONING="GridLayout">
      <form id="Form1" method="post" runat="server">  
       <asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 192px" runat="server"
        Text="服務器1"></asp:Button>  
       <asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 24px" runat="server"
        Height="144px" Width="280px" TextMode="MultiLine"></asp:TextBox>
       <asp:Label id="Label1" style="Z-INDEX: 103; LEFT: 32px; POSITION: absolute; TOP: 248px" runat="server"
        Height="96px" Width="248px">Label</asp:Label>
       <INPUT style="Z-INDEX: 104; LEFT: 192px; POSITION: absolute; TOP: 192px" type="button"
        value="客戶" id="bt11" onclick="aa();">
       <asp:Button id="Button2" style="Z-INDEX: 105; LEFT: 104px; POSITION: absolute; TOP: 192px" runat="server"
        Text="服務器2"></asp:Button>
       <asp:Label id="Label2" style="Z-INDEX: 106; LEFT: 312px; POSITION: absolute; TOP: 248px" runat="server"
        Width="208px" Height="88px">Label</asp:Label>
       <asp:HyperLink id="HyperLink1" style="Z-INDEX: 107; LEFT: 400px; POSITION: absolute; TOP: 32px"
        runat="server" NavigateUrl="select_test.aspx">select_text</asp:HyperLink>
      </form>
      <script language="javascript">
       function aa()
       {    
         //用這個方法獲取服務器端控件的數值。用DOM對頁面上的元素操作
         alert(document.getElementById(‘’TextBox1‘’).value+"---服務器控件數值");         
         //在讓客戶端代碼觸發回送事件。   
         alert("客戶端觸發事件");
         document.getElementById(‘’Button1‘’).click();   
       }
      
      </script>
     </body>

     private void Button1_Click(object sender, System.EventArgs e)
      {
         this.Label1.Text=this.TextBox1.Text;           
               this.Button2_Click(sender,e);//引發按扭2事件
      }

      private void Button2_Click(object sender, System.EventArgs e)
      {
        this.Label2.Text=this.TextBox1.Text;
      }



    -------------------------------------------------------------------------------------------------------------------------------

     <script language=javascript>
         function aa()
         {
           //alert(document.getElementById(‘’ListBox1‘’).value);//獲得select第一個被選中的元素       
           //alert(document.getElementById(‘’ListBox1‘’).length)//獲得多選框的總元素數目       
           //獲得select里所有被選中的元素
           for (var i=0;i<document.getElementById(‘’ListBox1‘’).length;i++)//獲得總長度
           {
               if (document.getElementById(‘’ListBox1‘’).options(i).selected) //檢測某一元素是否被選中
                   alert(document.getElementById(‘’ListBox1‘’).options(i).value);//獲得某元素的數值     
           }
         }
       
        </script>

    --------------------------------------------------------------------------------------------------------------------------------

    <body MS_POSITIONING="GridLayout">
      <form id="Form1" method="post" runat="server">
       &nbsp;
       <asp:button id="Button1" style="Z-INDEX: 101; LEFT: 48px; POSITION: absolute; TOP: 128px" runat="server"
        Text="服務器" Width="0px"></asp:button><INPUT style="Z-INDEX: 102; LEFT: 128px; POSITION: absolute; TOP: 128px" onclick="aa()"
        type="button" value="客戶端">
       <asp:label id="Label1" style="Z-INDEX: 103; LEFT: 40px; POSITION: absolute; TOP: 184px" runat="server"
        Width="184px" Height="80px">Label</asp:label><INPUT id="aa1" style="Z-INDEX: 104; LEFT: 40px; POSITION: absolute; TOP: 72px" type="text">&nbsp;
       <asp:textbox id="TextBox1" style="Z-INDEX: 105; LEFT: 40px; POSITION: absolute; TOP: 128px" runat="server"
        Width="0px"></asp:textbox><asp:label id="Label2" style="Z-INDEX: 106; LEFT: 416px; POSITION: absolute; TOP: 80px" runat="server"
        Width="272px" Height="144px"></asp:label></form>
      <script language="javascript">
       function aa()
       {    
         alert("客戶端觸發事件");    
         var aaaa=document.all.aa1.value; //獲得客戶端元素的數值    
         document.getElementById(‘’TextBox1‘’).value=aaaa; //把客戶端元素的數值保留入服務器端元素內     
         //alert(document.getElementById(‘’TextBox1‘’).value);//顯示服務器端元素的數值 
         document.getElementById(‘’Button1‘’).click();//使用腳本回送頁面    
       }
      
      </script>
     </body>


    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備10010545號-5
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>