January 9, 2013

TextBox 按Enter 指定執行Button Function

<asp:TextBox ID="Textbox1" runat="server" onkeydown="EnterKey()" Width="100%"></asp:TextBox>
<asp:Button ID="Querybtn" runat="server" Text="查詢"  onclick="Querybtn_Click" />
 


<script type="text/javascript">

        function EnterKey() {
            if (event.keyCode == 13) {
                document.getElementById("Querybtn").focus();
            }
        }
</script>

0推薦此文章
Today's Visitors: 0 Total Visitors: 11
Personal Category: Brian的程式筆記 Topic: learning / education / linguistic
[Trackback URL]

Reply
  • 1樓

    1樓搶頭香

    哨僓俠

    還不錯,加油喔,一起努力!
    本站的centos愛神是目前最有效保健食品,歡迎上網查詢"centos愛神"喔!
    深入了解: http://www.centos99.com/ 複製網址前往

    僵哆

  • at July 25, 2013 05:48 AM comment | Homepage
Post A Comment









Yes No



Please input the magic number:

( Prevent the annoy garbage messages )
( What if you cannot see the numbers? )
Please input the magic number

誰來收藏
Loading ...
unlog_NVPO 0