Is there a work-around to programmatically set focus on form field in iOS/Safari mobile

I would like to program iPod Touch 5's for use as scan guns, which means I need to be able to programmatically set the focus into a form field on page load. (My users do *not* want to have to touch the screen between scans.)


I've got the software working as a web app and styled for Safari mobile and Chrome right now, and I plan to re-write it in Sencha Touch 2. Unfortunately, it looks like Apple very deliberately keeps users from programmatically setting form field focus, and I haven't been able to find any work arounds or side-ways sidles into a solution.


Does anyone know a solution for this? Thanks!

iPod touch, iOS 6.0.1, Safari mobile or Chrome

Posted on Jan 15, 2013 2:50 PM

Reply
24 replies

Apr 29, 2013 12:04 AM in response to msuper69

It's not nonsense; here are some facts to bring you back to reality:

Jan 2013 - iPhone 5 production cut by 50%. Fact.

Mar 2013 - iPad Mini's sold 30% less in that quarter than the previous. Fact.

Apr 2013 - Apple stock falls 40% in two quarters. Fact


Since you insist, this is a brief description and walkthrough of what our web-app does:

Inventory management. Let's say you get a pallet of 100 laptops, and each one's serial number, part number, etc, need to be inputted. You type in things that are all the same: Apple, MacBook Air, April 2013, etc. etc. You click enter. HERE is where the page should automatically move the cursor to the HTML form automatically via the HTML5 autofocus attribute. I scan an item, the scanner inputs the data and hits enter (standard) the page reloads and we have the same page again. If the autofocus option is not functional, the user has to manually, (and accurately) click the (correct) text field every single time. This might not be a problem if proper scanners that accommodated the iPad in a gun-like fashion existed. The problem arises that the iPad is too heavy to be gun mounted, so you must use a hand-held Bluetooth scanner. No problem, right? Wrong; since you have to scan an item, put the scanner down, pick up the iPad, click on the text box, pick up the scanner, etc. etc. You get the idea. So it doesn't become ideal, it doesn't become a better process than what already exists (the Motorola scanners). Simply dropping the iPad and going with any other tablet fixes our problem. You type in the static information, put the tablet down, and continually, without interruption or margin for error, scan all items back to back using a very light (about 70 grams) device.


Anyway, here are some other facts that must be taken into consideration when evaluating the type of support for this situation. These devices will be used only for a single purpose, they'll have other purposes, but for 95% of its use cycle, it will serve one purpose: scan things. Millions of similar devices are used in the market today in warehouses, and in storage areas for inventory. Most of these devices are Motorola, but they are rarely updated, and very expensive. A new unit, top of the line, is about $2,000. Compare that with buying an iPod, or Galaxy player ($200), or buying an iPad or Surface ($500), coupled with a symbol Bluetooth scanner ($200), you have yourself a fine device, that's lighter, shockproof and at a fraction of the cost.. Some manufacturers even make sleeves for the iPod with scanners built-in to them. You can find lower-end models of these in all Apple store. That's why, if an iPad can't offer me HTML5 form autofocus, it loses its viability to compete with everything else on the market. Increasing the time it takes to scan a few hundred items a hundred-fold, thus drastically reducing productivity, increasing the probability for human-error, and most important of all, bad for the bottom line.


Also, I came here seeking support. All my comments (besides urging developers to find their solution in other platforms) we regarding support for Apple products. If you came here to start a flame-war, I respectfully request for you to withold all further erroneous comments, and I suggest you go read a Galaxy S4 thread on engadget, I'm sure there's one over there.

Apr 29, 2013 7:47 AM in response to T3kB0i

T3kB0i wrote:


I came here seeking support.

No you didn't. You came here looking to start a fight and insulting people.


Writing an app to do what you describe is trivially easy. It may be too difficult for the cut-rate web developer you hired, but that is your problem. A dedicated app could be run on an iPod touch and attached right to the scanner. The only reason you are using an iPad is because your cut-rate web developer probably doesn't know how to do mobile web sites either.

Dec 18, 2013 12:31 PM in response to MsComm

MsComm wrote:


What/where is the answer to the original question? I'm facing the same problem.

It would be best to start your own discussion topic. The problem described in this thread is very specific to someone trying to scan barcodes using only Safari. Safari is a web browser, not a barcode scanner.


If, for some reason, one of the many barcode scanners on the App Store do not suit your needs, you could write your own in a couple of hours.

Nov 12, 2015 6:08 PM in response to LilyGE

Apple has stuck their big fat foot in it with this ridiculous block of focus events. There is literally no workaround... Here's some constructive criticism: You could have added a setting on the keyboard that users can toggle, in case they find their keyboard popping-up annoying. But you decided to play God and control your precious user experience... you skulls of trivia.


For web apps that create dynamic content like trello, where you create a new task and want to automatically focus on the new card to start typing, you just CAN'T... you have to get your finger and plonk it on the screen for every new task.


Apple = PATHETIC

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Is there a work-around to programmatically set focus on form field in iOS/Safari mobile

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.