Results 1 to 3 of 3

Thread: Set Focus on a textbox in a mobile web app

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    1

    Question Set Focus on a textbox in a mobile web app

    Hi,

    I'm in a bit of a bind. I'm programming a mobile module for our production tracking system. We're using handheld Pocket PC scanners in the warehouse. The way I can program it is that they click on a textbox and then scan the barcode. I don't want them to have to click the textbox though. How can I set focus to a textbox in a mobile web app?

    JP

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: Set Focus on a textbox in a mobile web app

    I may be completely off on this one, because you are talking web, but there is a focus() method of textboxes that will set focus to that box.
    My usual boring signature: Nothing

  3. #3
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Set Focus on a textbox in a mobile web app

    VB Code:
    1. 'set the focus to the serial number field
    2.     Sub Set_Focus()
    3.         Dim strScript As String
    4.         strScript = "<script language=javascript> document.all('txtSerialNo').focus() </script>"
    5.         RegisterStartupScript("focus", strScript)
    6.     End Sub

    this works in normal asp.net
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width