I have a very simple web page with a form containing with 1-10 input field(s). I'm mostly using jquery. I need the first input field to be focused on as soon as you open the page. I am able to do this on most browsers and machines, but when I pull the application up on an IPAD it refuses to programically focus on anything if the event (previously 'onload') doesn't come from the end user (like a touch event).
I've tried to set the 'autofocus' property and that simply doesn't work.
I've tried to progamically create a button, then programically click it. I put the focus method inside of the click event, and that doesn't work.
The focus works when it's a result of user input.
$('input').first().focus();
This is the code I was trying to get working. It works on everything except the IPAD. If I bind this action to a 'touchstart' event, ao I knoW that it definitely works on an IPAD just can't be triggered from any event that isn't from the user. The idea is for the input to be ready to go without the user pressing the screen.
I don't care if the interactive keyboard opens up, as I am using external scanners for input. I just need the input field to be focused so it's ready to receive inputs without the user having to touch the screen at all.
It seems that apple implemented this 'feature' to prevent annoying the end user from having the keyboard pop up randomly.