2

I've got an html form text field that normally handles key up/down events. However, just noticed that if you use the mic assistant in ios5 mobile safari to fill the field for you, the key up/down isn't getting triggered.

Anyone know what event should be bound to instead to handle? Currently using jQuery w/o jQuery Mobile (file size restrictions) - plain JS would be super too. Am hoping I don't need to resort to polling.

Fiddle of demo code: http://jsfiddle.net/jfroom/wAdC8/5/

You can get to the mic functionality by clicking on the little mic icon on the text input tray.

Thanks in advance.

jfroom
  • 660
  • 7
  • 17
  • Seems to be polling is the way to go. Found a script to bind 'all' events ( http://stackoverflow.com/questions/5848598/how-all-events-of-dom-element-can-be-bind ) and still not getting anything triggering for a voice based input fill event. Here's the updated fiddle with 'all' event binding and interval catcher. Not sure what issues lie ahead for the interval running all the time, however. http://jsfiddle.net/jfroom/JLQLV/27/ – jfroom Feb 21 '12 at 21:24
  • Found the proper way to handle this with $input.bind("input propertychange", handler). Posting answer below. – jfroom Mar 08 '12 at 05:21

1 Answers1

5

Solution in jquery below. (I'm sure there's a pure JS equivalent very similar to this.)

$("#myinput").bind("input paste", handleChange);

Demo here: http://jsfiddle.net/jfroom/JLQLV/31/

.bind("input propertychange") also works, but can dilute other key up/down events. Thanks to SLaks for this find Jquery / JS bind "paste" event handler to input textbox

Community
  • 1
  • 1
jfroom
  • 660
  • 7
  • 17