RIRedinPA Posted November 10, 2009 Share Posted November 10, 2009 I'm trying to capture when the user clicks the "tab" key but am having no luck. Not getting any error messages but no alert either. Here's the code: function tabcheck(e) { var evt = e || window.event if (evt.keycode == 9) { alert("ok"); } } I'm building the <ul> list programmatically from a MySQL db... <li onmousedown=\"updatedb('" . $thisid . "');\" onmouseover=\"changebg('R" . $c . "C" . $f1 . "', 'over');\" onmouseout=\"changebg('R" . $c . "C" . $f1 . "', 'out');\"onKeyDown=\"tabcheck(event);\" id=\"R" . $c . "C" . $f1 . "\">" . $value . "</li> Quote Link to comment https://forums.phpfreaks.com/topic/180993-and-onkeydown/ Share on other sites More sharing options...
KevinM1 Posted November 10, 2009 Share Posted November 10, 2009 Wouldn't it make more sense to tie the event to the document as a whole? Quote Link to comment https://forums.phpfreaks.com/topic/180993-and-onkeydown/#findComment-954928 Share on other sites More sharing options...
RIRedinPA Posted November 10, 2009 Author Share Posted November 10, 2009 Wouldn't it make more sense to tie the event to the document as a whole? I should have provided more background: This is for a site that shows the workflow of magazine production. Each section/feature in the magazine has to go through the same series of checks (edit review, copy dropped, etc. etc.). We have teams of editors and teams of designers and this site allows them to document the progress of each section and leave comments/notes etc. My v1 was laid out in two tables, headers in one, content in another. I had a ton of issues (and still have) getting all the cells to line up. Started working on v2 and using thead and tbody tags but not all browsers want to play nice there either. I'm tinkering now with abandoning the table layout all together and simulating one with <div><ul><li>.....</ul></div> and some css and laying the list out horizontally. So far it works so much better, it seems a lot smoother. What I am missing though is the ability to tab through the "cells"...I id each <li> with a R#C# so I can track where the user is within the ul/li grid...so what I am trying to do is when a user clicks tab to make the next sequential grid cell active Quote Link to comment https://forums.phpfreaks.com/topic/180993-and-onkeydown/#findComment-954945 Share on other sites More sharing options...
KevinM1 Posted November 10, 2009 Share Posted November 10, 2009 AFAIK, list items aren't focusable, so they can't be tabbed. What can be tabbed are the elements inside them, depending on what they are. Try attaching the tracking to the items within the list items. Quote Link to comment https://forums.phpfreaks.com/topic/180993-and-onkeydown/#findComment-954953 Share on other sites More sharing options...
RIRedinPA Posted November 10, 2009 Author Share Posted November 10, 2009 AFAIK, list items aren't focusable, so they can't be tabbed. What can be tabbed are the elements inside them, depending on what they are. Try attaching the tracking to the items within the list items. Thanks, that'll save me hours of barking up the wrong tree, I could put input items inside which can also be indexed Quote Link to comment https://forums.phpfreaks.com/topic/180993-and-onkeydown/#findComment-954973 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.