www.webdeveloper.com
Results 1 to 4 of 4

Thread: tab past a read only textbox

  1. #1
    Join Date
    Jun 2004
    Location
    Kansas City, MO
    Posts
    1,607

    tab past a read only textbox

    I have a textbox that i am using as a counting field.
    when you are tabbing it tabs to this textbox.

    I have the textbox set to readonly.

    All im looking for is a quick way to tell it that if that textbox gets focus to send the focus to the next element.

    <input type=text name=txtCounter value=1000 onfocus="?">

    Any suggestions?

  2. #2
    Join Date
    Jun 2004
    Location
    Kansas City, MO
    Posts
    1,607
    ok i got it, let me know if there is a better way to do it.

    Code:
    function MoveNext(obj){
    	document.getElementById(obj).focus();
    }
    
    <input type=text name=txtCounter Id=TC onfocus="MoveNext('ID OF FIELD I WANT FOCUS TO MOVE TO');">

  3. #3
    Join Date
    Sep 2004
    Location
    Midwest
    Posts
    1,629
    Give the input fields your choice of consecutive tabindex values. Give the readonly fields a tabindex of -1

    <input type=text name=txtCounter value=1000 tabindex=-1>

  4. #4
    Join Date
    Jun 2004
    Location
    Kansas City, MO
    Posts
    1,607
    I like that alot better.
    Very nice,
    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles