Mathachew / jquery-autotab

A jQuery plugin that provides auto tabbing and filtering on text fields in a form
http://autotab.mathachew.com/
366 stars 98 forks source link

autotab number breaks oninput handler #103

Open CharlieReitzel opened 7 years ago

CharlieReitzel commented 7 years ago

For input elements like so, <input type="text" class="number" oninput="myhandler();" ...>, the oninput handler is called for every input but the last one (when auto-tabbing to next field).

That's the one that I really need, btw. Since the handler will enable the submit button when the input is valid. onchange still works. But this has problems when the button to be enabled is next in the tab order. The onchange event fires too late and whatever is after the button gets focus. So we really need oninput.

We have a group of 3 such fields in the form. Our work-around is to change the type of the last field to 'tel' from 'text'. But this effectively turns off the important features of autotab() (for us, anyway).

This is very similar to your phone number example here: http://www.mathachew.com/sandbox/jquery-autotab/#number1

The example would be that we want to also have an oninput handler for those fields.

Any guidance on how to use autotab() and still keep our oninput handler?