Set textbox focus in mobile safari

后端 未结 3 929
死守一世寂寞
死守一世寂寞 2020-12-11 01:40

Hey, I was wondering how to set the focus to a text box in Mobile Safari.

I\'ve tried document.myForm.myTextArea.focus() which works in regular Safari,

相关标签:
3条回答
  • 2020-12-11 02:19

    Nothing to do with the timer, focus() doesnt work at all... im doing mine through an AJAX function. i guess my web application will have to suffer in mobile safari.

    Bye the way, this also affects HP webOS devices and any other device using mobile safari

    0 讨论(0)
  • 2020-12-11 02:41

    Just found this previous post stating this is a bug in webkit. Sorry for not doing a more thorough search.

    http://discussion.forum.nokia.com/forum/showthread.php?t=127724

    0 讨论(0)
  • 2020-12-11 02:42

    I found a bug report with the iUI project relating to this.

    It seems that a focus() call will not work if called from the onload event or if called via a timer.

    http://code.google.com/p/iui/issues/detail?id=129

    Update: Although I have no source for this, I am told (by people who have tried it) that in iPhone OS 4 the problem with focus() and onload should be fixed.

    0 讨论(0)
提交回复
热议问题