1

HOWEVER, when I hit TAB it takes me to the address bar and THEN if I hit tab again it takes me through the rest of the items on the page.

I set the tab index of the first item to 11 and then incrimented from there (I had read that IE's toolbars have tab indexes too so I thought perhaps using a higher number would bypass those, but again that doesn't REALLY make sense since it would still start at the lowest number, but I gave it a shot thinking it would move forward from where the focus was set.) If I click on the textbox and then hit TAB it DOES move through the page like I would expect.

It is just when the page loads and gets the focus set to the employeeID textbox that hitting tab moves it to the address bar.

I also tried setting the other controls to -1 (those I didn't want it to tab to), still no luck there.

So... what can I do to get around this?

There MUST be a simple way to set the focus to the employeeID textbox and ensure that pressing TAB after that moves to the next control in the formview's insert template and does NOT jump up to the address bar?

4

1 に答える 1

2
$(window).load(function () {
    $('.wizardContent :visible:input:enabled:first').focus();
});
$('body').on('keydown', '.wizardContent :visible:input:enabled:first', function (e) {
    if ((e.which == 9) || (e.keyCode == 9)) {
        $('.wizardContent :visible:input:enabled:first').focus();
    }
});
于 2013-08-22T11:20:09.323 に答える