Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how can I keep the focus on login button, when I enter the username / password?

Posted on 2011-02-28
5
Medium Priority
?
366 Views
Last Modified: 2012-05-11
so when the user hit the enter button the focus is on the login.

    <form id="form1" runat="server">
    <div>
        <div style="float: right">
            <asp:Button ID="NewUser" OnClick="NewUser_Click" Text=" New Users " runat="server"
                ToolTip="If you are a new user please click here" />
        </div>
        <br />
        <asp:Label ID="msgGeneral" BackColor="#006600" runat="server" ForeColor="White"></asp:Label><br />
        <br />
        <asp:Label ID="Label1" runat="server" Text="UserName:"></asp:Label>&nbsp;&nbsp;
        <asp:TextBox ID="UserName" runat="server"></asp:TextBox><br />
        <br />
        <asp:Label ID="lPassword" runat="server" Text="Password:  "></asp:Label>&nbsp;&nbsp;
        <asp:TextBox ID="Password" runat="server" ToolTip="Please enter password" TextMode="Password"></asp:TextBox><br />
        <br />
        <asp:Button ID="Login" runat="server" Text="Login" OnClick="Login_Click" />
        <br />
        <br />
        <br />
    </div>
    </form>
0
Comment
Question by:goodk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 35003955
0
 
LVL 40

Assisted Solution

by:Gurvinder Pal Singh
Gurvinder Pal Singh earned 500 total points
ID: 35003975
<<how can I keep the focus on login button,  when I enter the username / password?>>
you can't, since while you are typing, the focus will be on that text input control

you can simply do the submit at enter key press
http://www.beansoftware.com/ASP.NET-Tutorials/Accept-Enter-Key.aspx
0
 
LVL 8

Assisted Solution

by:Anurag Agarwal
Anurag Agarwal earned 500 total points
ID: 35004223
goodk u don't need to keep the focus on login button just make tht button as a default button which means tht whenever enter key is pressed login button will be clicked

<form id="form1" runat="server" defaultbutton="Login">

this will help u ................
0
 
LVL 17

Assisted Solution

by:selvol
selvol earned 500 total points
ID: 35006385


      <form id="form1" runat="server" defaultfocus="Button1" >

  <asp:Button ID="Button1" runat="server" Text="Button" />


Selvol
0
 

Author Closing Comment

by:goodk
ID: 35009136
thanks
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question