DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Tom Guest

    Front of the queue when the page loads


    I have a login page for my web database system.
    How can i make it so the "User" Input text box
    is the highlighted field and when the page loads
    the user can start typing his/her id in first?

    help please

    Tom.

  2. #2
    BigMomma Guest

    Re: Front of the queue when the page loads

    Hope this helps:

    This is the form (frmMain) and the text-box (txtLogin):

    <form name="frmMain" method="POST" action="--WEBBOT-SELF--">
    <!--webbot bot="SaveResults" u-file="fpweb:///_private/form_results.csv"
    s-format="TEXT/CSV" s-label-fields="TRUE" --><p>
    <input type="text" name="txtLogin" size="20"><input type="submit"
    value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>


    This is a little script to set the focus:

    <script language="JAVASCRIPT">
    SetFocus()

    function SetFocus()
    {
    document.all.frmMain.txtLogin.focus();
    }
    </script>


    Note: the script has to be located at the end of the html-code, because the
    text-box is not loaded at the beginning of the file.

    BigMomma



  3. #3
    Tom Guest

    Re: Front of the queue when the page loads


    "BigMomma" <FakeMail@FakeDomain.com> wrote:
    >Hope this helps:
    >
    >This is the form (frmMain) and the text-box (txtLogin):
    >
    ><form name="frmMain" method="POST" action="--WEBBOT-SELF--">
    > <!--webbot bot="SaveResults" u-file="fpweb:///_private/form_results.csv"
    >s-format="TEXT/CSV" s-label-fields="TRUE" --><p>
    > <input type="text" name="txtLogin" size="20"><input type="submit"
    >value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    ></form>
    >
    >
    >This is a little script to set the focus:
    >
    ><script language="JAVASCRIPT">
    > SetFocus()
    >
    > function SetFocus()
    > {
    > document.all.frmMain.txtLogin.focus();
    > }
    ></script>
    >
    >
    >Note: the script has to be located at the end of the html-code, because

    the
    >text-box is not loaded at the beginning of the file.
    >
    >BigMomma
    >
    >

    Worked a treat, Thanks!

    Tom

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links