D
David McDivitt
I need to set tabs on java generated pages. Pages have four sections:
header, sidebar, body, and footer. The sidebar and body change dynamically.
The tab key must go to anchors, fields, and buttons doing all in the header
first, all in the sidebar second, etc. A base page contains includes for all
the pieces and has the body tag.
I am trying to use code pasted below. Help would be appreciated. Thanks
<script language="javascript">
<!--
tab = 0;
if(document.all && !document.getElementById) {
document.getElementById = function(id) {
return document.all[id];
}
}
function setTabs (childObject) {
for (j=0;j<childObject.childNodes.length;j++) {
try {
childObject.childNodes[j].tabIndex = tab;
tab++;
if
(childObject.childNodes[j].childnodes.length > 0)
setTabs(childObject.childNodes[j]); //should not have to check length before
recurse
}
catch (e) {
}
}
}
function onLoadEvent() {
setTabs(document.getElementById('divTopHeader'));
setTabs(document.getElementById('divTopMenu'));
setTabs(document.getElementById('divTopBody'));
setTabs(document.getElementById('divTopFooter'));
}
//-->
</script>
header, sidebar, body, and footer. The sidebar and body change dynamically.
The tab key must go to anchors, fields, and buttons doing all in the header
first, all in the sidebar second, etc. A base page contains includes for all
the pieces and has the body tag.
I am trying to use code pasted below. Help would be appreciated. Thanks
<script language="javascript">
<!--
tab = 0;
if(document.all && !document.getElementById) {
document.getElementById = function(id) {
return document.all[id];
}
}
function setTabs (childObject) {
for (j=0;j<childObject.childNodes.length;j++) {
try {
childObject.childNodes[j].tabIndex = tab;
tab++;
if
(childObject.childNodes[j].childnodes.length > 0)
setTabs(childObject.childNodes[j]); //should not have to check length before
recurse
}
catch (e) {
}
}
}
function onLoadEvent() {
setTabs(document.getElementById('divTopHeader'));
setTabs(document.getElementById('divTopMenu'));
setTabs(document.getElementById('divTopBody'));
setTabs(document.getElementById('divTopFooter'));
}
//-->
</script>