0

on page load im focusing the input by finding the error class and it works fine in desktop and android, but not in iPhone. If someone has gone through this issue can you guys please suggest.

Thanks!!

DEMO :

JS :

(function($) {
    $(function(){

            $('.form-field-container').find('input.error').each(function (i,e) {
                if ( $(this).hasClass('error') == true ) {
                    if(i==0){
                        $(this).focus(function(e) {
                            setTimeout(function() {
                                $(this).trigger('click');
                                $(this).click();
                            }, 200);
                        })
                    }
                } else { }
            })

    });
})(jQuery);
Developer
  • 1,409
  • 2
  • 23
  • 46
  • This is a known iOS bug – Drakes Jun 10 '15 at 04:05
  • @Drakes :thanks for reply, is there some workaround for this ?, client needs this, he not technically good – Developer Jun 10 '15 at 04:06
  • Have a look [here](http://stackoverflow.com/questions/18728166/programatically-focus-on-next-input-field-in-mobile-safari) and [here](http://stackoverflow.com/questions/12204571/mobile-safari-javascript-focus-method-on-inputfield-only-works-with-click) – Drakes Jun 10 '15 at 04:08

0 Answers0