Log in

View Full Version : tab key



petesmit1
04-04-2007, 10:58 AM
Anyone know if its possible to get the tab key to fuction on its own in 6 second intervals?

codeexploiter
04-04-2007, 12:07 PM
Are you looking for something like the following



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript">
function pressTab(name)
{
var elem = document.getElementById(name);
elem.focus();
return;
}
function init(name){
setTimeout("pressTab('"+name+"')",6000);
return;
}

</script>
</head>

<body onload="document.forms[0].box1.focus();">
<form name=yourform>
Text Box 1: <input type=text id=box1 name=box1 onFocus="init('box2');"><br>
Text Box 2: <input type=text id=box2 name=box2 onFocus="init('box3');"><br>
Text Box 3: <input type=text id=box3 name=box3 onFocus="init('box4');"><br>
Text Box 4: <input type=text id=box4 name=box4 onFocus="init('done');"><br>
<input type=submit id=done name=done value="Submit">
</form>
</body>
</html>

petesmit1
04-04-2007, 12:12 PM
man thats class, though I need it to scroll through links instead of text box but I guess I can just adapt the code??

would it be poss for me to put a rollover in there too?

thanks man so much!

petesmit1
04-23-2007, 11:25 AM
does anyone know if this would work for an actual textual link?

thanks
pete

tech_support
04-23-2007, 11:32 AM
Are you looking for something like the following



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript">
function pressTab(name)
{
var elem = document.getElementById(name);
elem.focus();
return;
}
function init(name){
setTimeout("pressTab('"+name+"')",6000);
return;
}

</script>
</head>

<body onload="document.forms[0].box1.focus();">
<form name=yourform>
Text Box 1: <input type=text id=box1 name=box1 onFocus="init('box2');"><br>
Text Box 2: <input type=text id=box2 name=box2 onFocus="init('box3');"><br>
Text Box 3: <input type=text id=box3 name=box3 onFocus="init('box4');"><br>
Text Box 4: <input type=text id=box4 name=box4 onFocus="init('done');"><br>
<input type=submit id=done name=done value="Submit">
</form>
</body>
</html>

Remember to use quotes.

djr33
04-23-2007, 11:36 AM
It is possible to use javascript, as above, to set focus to an element of a form.
I'm not sure it's possible to focus a link.
Just try setting focus to it, I suppose, but I doubt that's possible, honestly.