Setting focus to a text box


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Setting focus to a text box

  1. #1
    cmoore Guest

    Setting focus to a text box


    Hi all,

    This isn't a ASP question, but I wasn't getting any answers in other groups
    so I thoug I would try you guys. I'm trying to set focus to a specific
    text box in a specific form, I can't think of any way to do this and I was
    wondering if anyone does or if it's possible.

    Thanks

    Colin Moore
    DFO Canada


  2. #2
    Matt Markus Guest

    Re: Setting focus to a text box

    Hi Colin --

    "cmoore" <cmoore_programmer@yahoo.ca> wrote in message
    news:3b30a99f$1@news.devx.com...
    >
    > Hi all,
    >
    > This isn't a ASP question, but I wasn't getting any answers in other

    groups
    > so I thoug I would try you guys. I'm trying to set focus to a specific
    > text box in a specific form, I can't think of any way to do this and I was
    > wondering if anyone does or if it's possible.
    >
    > Thanks
    >
    > Colin Moore
    > DFO Canada
    >



    <HTML>

    <BODY onload="SetFocus();">

    <form name=form1>
    <input type=text name=text1 size=20>
    </form>

    </BODY>
    </HTML>

    <script language="javascript">
    function SetFocus()
    {
    document.form1.text1.focus();
    }
    </script>

    -Matt



  3. #3
    cmoore Guest

    Re: Setting focus to a text box


    "Matt Markus" <matt_markus@hotmail.com> wrote:
    >Hi Colin --
    >
    >"cmoore" <cmoore_programmer@yahoo.ca> wrote in message
    >news:3b30a99f$1@news.devx.com...
    >>
    >> Hi all,
    >>
    >> This isn't a ASP question, but I wasn't getting any answers in other

    >groups
    >> so I thoug I would try you guys. I'm trying to set focus to a specific
    >> text box in a specific form, I can't think of any way to do this and I

    was
    >> wondering if anyone does or if it's possible.
    >>
    >> Thanks
    >>
    >> Colin Moore
    >> DFO Canada
    >>

    >
    >
    ><HTML>
    >
    ><BODY onload="SetFocus();">
    >
    ><form name=form1>
    > <input type=text name=text1 size=20>
    ></form>
    >
    ></BODY>
    ></HTML>
    >
    ><script language="javascript">
    > function SetFocus()
    > {
    > document.form1.text1.focus();
    > }
    ></script>
    >
    >-Matt
    >
    >

    Thanks a lot Matt!


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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center