Focus does not work on android

I am creating an android application using jquery mobile (windows 7). I have a focus function and using this function, for example: you have a text field and you want the text field to accept only numbers, and if you enter any string values, an error will appear. The problem is that when I run the application on a mobile device, the focus function does not work. (it works, if you specify a line, an error will appear, but then you can’t click on other fields, and when you click on the same field, the error message will win, you have to delete it manually), but when I run that same code on my localhost, it works fine.

+4
source share
1 answer

I would use the autofocus and template attributes available in html5. autofocus is quite simple in that the field on which it will be displayed will focus on loading the page, and the template allows you to specify the regular expression to which this specific field should be attached. http://html5pattern.com/

+1
source

All Articles