Question

I wonder if it is possible to validate with JS some Siri-driven (or Android Speech Recognition software) input on mobile devices.

I have a "input type=text" object, but I need to enable only digits (numbers). I'm using keydown/keyup to trap and delete keyboard inputs but if the user enables Siri and then talks, the textfield is pupulated with strings...

Is there any event I can listen for?

Was it helpful?

Solution

If the following is true, you pretty much solved the problem: "if the content of the input changed in X ms and no key has been typed in X ms, then a software aid has been used".

Or, put another way, you can know if the text changed and the user typed something (or not)

OTHER TIPS

Could you use input type='number'?

Here is a list of support.

http://caniuse.com/#feat=input-number

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top