darkpaw

Q: Mobile Safari: Can we set focus to a text field?

I'm developing a web app for work that allows a user to scan a barcode into a field on the screen, and then deal with the information for that code. However, I can't see any way of setting focus to the text field (there's only this and a button) when you load that page. Mobile Safari doesn't seem to support normal focus settings.

Any ideas?

Mac Pro 8x2.8GHz, Mac OS X (10.5.7), 10GB RAM, 3TB, 8800GT

Posted on Oct 22, 2010 5:43 AM

Close

Q: Mobile Safari: Can we set focus to a text field?

  • All replies
  • Helpful answers

  • by Carolyn Samit,

    Carolyn Samit Carolyn Samit Oct 22, 2010 6:23 AM in response to darkpaw
    Level 10 (120,054 points)
    Apple Watch
    Oct 22, 2010 6:23 AM in response to darkpaw
    Hi ...

    Might be some help in the Safari Dev center for you.

    http://developer.apple.com/devcenter/safari/index.action








    Carolyn
  • by ValtechIndia,

    ValtechIndia ValtechIndia Apr 6, 2012 6:42 AM in response to darkpaw
    Level 1 (0 points)
    Apr 6, 2012 6:42 AM in response to darkpaw

    Hi Darkpaw,

     

    I have the same requirement. I dont have any idea how to do that? Can you please suggest me? Can we use iPad camara as scanner on using iPad safari web app?

     

    Thanks in advance

  • by T3kB0i,

    T3kB0i T3kB0i Apr 28, 2013 9:42 PM in response to darkpaw
    Level 1 (0 points)
    Apr 28, 2013 9:42 PM in response to darkpaw

    We are currenty developing a web-app inventory management system with Symbol bluetooth scanners. The page needs to automatically focus onto a form field, as hundreds of things need to be scanned, and doesn't increase the time required by the user. If we had to select the field every single time, it would take hours longer, and as such, wouldn't be logical to use. The original plan was to make them work with the client's existing iPads. Obviously it works flawlessly on any desktop browser, but it also works on WinMo 6+, Windows Phone, and Android. While aging, we gave it a shot to make it work on the iPad as well. After reaching a dead end with mobile Safari, this gave us a great reason to recommend the upgrade all tablets to Surface.

     

    I've been on dozens of threads, looking for a solution. Increasing production time by another month, and maintaining a seperate development cycle through an exclusively native iOS app is not worth our time, and is not what the customer wants.

     

    Apple's response is that this type of application isn't appropriate for a web-app, and offers no options to fix this crippling bug. Suggesting that one builds a native app instead.

     

    I disagree, we have deployed our inventory management web-app in many business with great success and user satisfaction, and mobile devices are a natural progression. While iOS is obviously a walled garden, jailbr3aking doesn't offer any solutions either. iOS is a sinking ship, the only solution is to jump boat to any one of the superior platforms.

  • by Simon Slavin,

    Simon Slavin Simon Slavin Apr 29, 2013 3:59 AM in response to darkpaw
    Level 4 (1,400 points)
    Apr 29, 2013 3:59 AM in response to darkpaw

    If I understand correctly you are trying to have a web page start off with the cursor in a particular field.  The standard JavaScript code used for all browsers, which is triggered when the page loads and can put the cursor into a specific field, works fine.  Just write your a JavaScript routine that works for other browsers and it will work on Mobile Safari.  I do it in my own pages without problems.

     

    To the question about operating camera from a web or bluetooth scanner from your web browser, I'm not sure how you expected to do that.  There's nothing in the standards for web browsers that tell them how to interact with a camera.  Do you have something that works in FireFox and Chrome and talks to a webcam ?  If so, what functions are you calling ?

  • by Gohl,

    Gohl Gohl Aug 24, 2016 7:22 AM in response to darkpaw
    Level 1 (4 points)
    iPad
    Aug 24, 2016 7:22 AM in response to darkpaw

    Has this ever been resolved?  I am having the same issue.  I have a web page that we would like to use a barcode scanner on, and the textbox.focus() doesn't work.  I know this is a 6 year old post, so maybe there has been a change?