Results 1 to 6 of 6

Thread: tab key

  1. #1
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default tab key

    Anyone know if its possible to get the tab key to fuction on its own in 6 second intervals?

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Are you looking for something like the following

    Code:
    <!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>

  3. #3
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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!

  4. #4
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    does anyone know if this would work for an actual textual link?

    thanks
    pete

  5. #5
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Quote Originally Posted by codeexploiter View Post
    Are you looking for something like the following

    Code:
    <!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.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •