Tab jump

Results 1 to 2 of 2

Thread: Tab jump

  1. #1
    Join Date
    Dec 1969

    Default Tab jump

    I have 3 text boxes that only accept 3 characters each. As the length = 3 for the first text box I automatically shift the user to the second text box and then finally on to the third one. As the 3 characters are entered into the third box the focus is shifted to the Submit button. My problem is now the user cannot go back and delete any of the data from all three of the text boxes. And if they hit the backspace key it brings them to the previous page in history. I know that the problem is the fact that when I check for the length of 3 the focus is automatically shifted to the next box never allowing for the length to change. How can I go about working around this?<BR><BR>Here is my function for automatically shifting to the next box:<BR><BR>function myFunction(myControl) <BR>el = cint(right(,1))<BR> if el = 1 then <BR> if len(myControl.value) = 3 then <BR> document.frmBranchInput.txtBaseIP2.focus() <BR> end if <BR> end if <BR> if el = 2 then<BR> if len(myControl.value) = 3 then <BR> document.frmBranchInput.txtBaseIP3.focus() <BR> end if<BR> end if<BR> if el = 3 then <BR> if len(myControl.value) = 3 then <BR> document.frmBranchInput.btnSubmit.focus() <BR> end if <BR> end if<BR>end Function <BR>

  2. #2
    Bill Spurling Guest

    Default RE: Tab jump

    Steph,<BR>It sounds like you are using the onfocus...or there is an error in your logic....I really could not follow your vb code snipplet b/c I need to see it in the actual page. However, it seems like you function should work. <BR><BR>try using the onKeyDown or on onKeyUp attributes inside the input tag instead of the onfocus. That should rectify your situation, if I understand it correctly.<BR><BR>Hope this helps,<BR>Bill

Posting Permissions

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