Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Force TAB key in javascript

    I am working on a asp program where input boxes are created dynamically. These input boxes have maximum of just 1 char.
    ie. just one char allowed per input box.

    I need a script for automatically putting the cursor to next input box on keying some value to input. How can i do this?

    sridhar

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Planet Earth Code Poet: True
    Posts
    282
    Thanks
    0
    Thanked 1 Time in 1 Post
    Show us how the boxes are written out so we can show you the easiest way to implement it.

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    the code used by me

    I have used the following code in asp:

    <%y=rs1("Word1_Position")%>
    for i=1 to len(y)
    if mid(y,i,1) = "*" then%>
    <input type="text" taborder=<%=i%> name="T1<%=i%>" size="1" maxlength="1" style="border-style: solid; border-color: #FF0000" >

    <%else%>
    <input type="text" taborder=<%=i%> name="T1<%=i%>" size="1" maxlength="1" style="border-style: solid; border-color: #000000" >
    <%end if
    next%>

    All the inputs of maxlength1. What i want is to move to the next taborder automatically once the current input is filled.

    sridhar

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Planet Earth Code Poet: True
    Posts
    282
    Thanks
    0
    Thanked 1 Time in 1 Post
    You could try something like this:

    <input type="text" taborder=<%=i%> name="T1<%=i%>" onkeyup="document.FormName.T1<%=i+1%>.focus()" size="1" maxlength="1" style="border-style: solid; border-color: #FF0000" >

    Be sure to replace FormName with the name of your form.

  • #5
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you.

  • #6
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your suggession works well - as long as TAB / SHIFT+TAB is not used.

    When i use Tab, it goes forward twice and shift+tab does not stay at previous tab order- moves to next tab order.

    any way to overcome?

    sridhar


  •  

    Posting Permissions

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