Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
Hai,
 
In Webpage when user press tab key it should focus only save button.
 

any ideas guys,
Posted 15-May-12 2:37am
Comments
sharmarun at 15-May-12 7:46am
   
controlname.focus();
Technoses at 29-May-12 6:50am
   
if your problem got solved! Please mark it as solution
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can override the Controls' KeyDown[^] event and manually move the focus over to the Control that should receive focus.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

you can use
 
<body onkeydown="kd();"></body>
 

    function kd()
    {
        if(event.keyCode==9)
        {
            document.getElementById("btn").focus();
        }
    }
  Permalink  
Comments
Sandeep Mewara at 15-May-12 10:28am
   
My 5!
Technoses at 15-May-12 11:59am
   
if problem solved. mark it as solution
Sandeep Mewara at 15-May-12 12:21pm
   
I cannot. :)
 
Only the person who asks question can.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Set Button Property
 
<asp:button id="button1" tabindex="1" runat="server"/>
  Permalink  
v3
Comments
Anuja Pawar Indore at 15-May-12 10:40am
   
Added pre tag
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

try like this,
 
<body>
    <form id="form1" runat="server">
     <script type="text/javascript">
         var txt = document.getElementById("nameTextBox1");
         if (txt != null)
          {
             txt.focus();
          }
        </script>
    <div>
 
<table>
   <tr>
      <td class="style1">
        what is u r name :&nbsp;  <asp:TextBox ID="nameTextBox1" runat="server"></asp:TextBox>
      </td>
   </tr>
   <tr>
       <td class="style1">
         enter u r age&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   :&nbsp;
         <asp:TextBox ID="nextTextBox2" runat="server"
            ontextchanged="nextTextBox2_TextChanged" > </asp:TextBox>
      </td>
   </tr>
    <tr>
 
    </tr>
 </table>
 
    &nbsp;&nbsp;
 
    </div>
 
    </br>
    <div>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <asp:Button ID="Button1" runat="server" Text="on click" >
               </asp:Button>
        </div>
    </form>
</body>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Kornfeld Eliyahu Peter 169
1 Zoltán Zörgő 139
2 George Jonsson 135
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 15 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100