vendredi 15 janvier 2016

Enter to Tab script does not pass over a checkbox?

I am trying to convert enter into tab, and it works perfect with my form fields, but not a checkbox on my page. Anyone have any ideas as to why not?

Enter to Tab code :

<script type="text/javascript">
function tabE(obj, e) {
  var e = (typeof event != 'undefined') ? window.event : e; // IE : Moz

  var self = $(obj),
    form = self.parents('form:eq(0)'),
    focusable, next;

  if (e.keyCode == 13) {
    focusable = form.find('input,a,select,button,textarea').filter(':visible');
    next = focusable.eq(focusable.index(obj) + 1);
    if (!next.length) {
      next = focusable.first();
    }
    next.focus();
    return false;
  }
}
</script>

The Evil Checkbox :

<input class="case" type="checkbox"/>




Aucun commentaire:

Enregistrer un commentaire