开发者

iPhone Trigger keyboard in input field (HTML / Javascript)

开发者 https://www.devze.com 2023-03-02 10:41 出处:网络
I am trying to set a few input field connectd to each other. in the 1st field you can enter 3 digit in the 2nd field you can enter 3 digit

I am trying to set a few input field connectd to each other.

in the 1st field you can enter 3 digit in the 2nd field you can enter 3 digit in the 3rd field you can enter 4 digits

When i the first field as 3 digits, i would like to have the focus move to the 2nd one and same for the moving to teh 3rd one.

Using not so smart javascript it ie working, however on iPhne there is an issue: whene the focus is moved to the 2nd field, althouth i manage to create and trigger different events on eh field, the on screen keyboard do not want to reappear.

I tried to use simple focus() method. Then to create and dispatch focus event, click event touchstart event, touch end event but i di dnot manage to figure out how to make the browser s开发者_Go百科how the keyboard.

Is there anyone out there with an idea how to do this? HELP

Thx

Daniel


An element.focus() should show the keyboard. You must be doing something wrong. Additionally if all your input / text areas are in a form element it should auto advance to the next element. You can also use element.blur() to hide the keyboard.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号