APRESTOUS
asked on
Get needed behaviour onkeyup
Hello,
This is the code I use to
Function Edit() is online editor, so it transforms table cell to select form. It works.
But the problem is that when I press tab (being inside of select) browser (Firefox) first gives focus to address , then to the next focusable element .
Only when (after few tabs) it comes back to the same select form and I press tab again I get function Edit() working.
So it looks like browser fires own event on tab and ignoring my custom.
An idea how to solve it?
This is the code I use to
<script type="text/javascript">
function ControlKey(event) {
switch (event.keyCode)
{
case 9:
if(active_id!='') {
Edit();
}
break;
case 13:
break;
}
}
$(document).ready(function () {
$(window).keyup(function(event) {
ControlKey(event);
});
});
Function Edit() is online editor, so it transforms table cell to select form. It works.
But the problem is that when I press tab (being inside of select) browser (Firefox) first gives focus to address , then to the next focusable element .
Only when (after few tabs) it comes back to the same select form and I press tab again I get function Edit() working.
So it looks like browser fires own event on tab and ignoring my custom.
An idea how to solve it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Probably clue was is "keypress" instead of "keyup"
Thank you!