if input has focus open keypad in iphone

80 views Asked by At

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);
0

There are 0 answers