Help? Need to autotab between fields . . .

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    Help? Need to autotab between fields . . .

    Hi! I'm putting together a data entry form. One of the entries will
    be a telephone number. I've been directed to implement this by using
    three separate fields -- the first being for area code, the second for
    exchange, and the last for the last 4 digits of the phone number.

    When users enter 3 digits in the area code field, instead of hitting
    the tab key to move to the exchange field, I want this to happen
    automatically upon entry of the last digit. And after the 3 digit
    exchange is entered, they should automatically tab to the last field.

    Can someone help? If script is required, can you tell me where to
    find an example? I'm new to this, have little experience with script,
    and am being rushed to finish.

    Thanks in advance,

    Mike
  • Andrew Urquhart

    #2
    Re: Help? Need to autotab between fields . . .

    *Mike* wrote:[color=blue]
    > Hi! I'm putting together a data entry form. One of the entries will
    > be a telephone number. I've been directed to implement this by using
    > three separate fields -- the first being for area code, the second for
    > exchange, and the last for the last 4 digits of the phone number.
    >
    > When users enter 3 digits in the area code field, instead of hitting
    > the tab key to move to the exchange field, I want this to happen
    > automatically upon entry of the last digit. And after the 3 digit
    > exchange is entered, they should automatically tab to the last field.
    >
    > Can someone help? If script is required, can you tell me where to
    > find an example? I'm new to this, have little experience with script,
    > and am being rushed to finish.[/color]

    Sounds like one of those forms that I fill in every day and go into
    auto-pilot when I do so. Except in this case when I look back at the
    screen after completing the form it might look like:

    Name: Andrew Urquhart
    Phone: 01234 [blank] 567
    Address: 789
    City: 221b Baker Street
    Post Code: London

    .... because I expected the form to function like other forms I'm used to
    filling in and I used the tab key without realising that there was some
    script in there that was trying to be helpful, but actually got in the
    way and confused things. When I go back to edit the phone number I'd bet
    that the script will keep 'helpfully' pushing the cursor into the next
    input box as I try to delete '567'. So in summary I'd argue that the
    requirements are unhelpful to the user, well, if that user is me at
    least :-)
    --
    Andrew Urquhart
    - FAQ: www.jibbering.com/faq/
    - Archive: www.google.com/groups?q=comp.lang.javascript
    - My reply address is invalid, see www.andrewu.co.uk/contact/


    Comment

    • Richard Cornford

      #3
      Re: Help? Need to autotab between fields . . .

      Andrew Urquhart wrote:
      <snip>[color=blue]
      > Sounds like one of those forms that I fill in every day and go into
      > auto-pilot when I do so. Except in this case when I look back at the
      > screen after completing the form it might look like:
      >
      > Name: Andrew Urquhart
      > Phone: 01234 [blank] 567
      > Address: 789
      > City: 221b Baker Street
      > Post Code: London
      >
      > ... because I expected the form to function like other forms I'm used
      > to filling in and I used the tab key without realising that there was
      > some script in there that was trying to be helpful, but actually got
      > in the way and confused things. When I go back to edit the phone
      > number I'd bet that the script will keep 'helpfully' pushing the
      > cursor into the next input box as I try to delete '567'. So in
      > summary I'd argue that the requirements are unhelpful to the user,
      > well, if that user is me at least :-)[/color]

      It is one of those requirements that are thought up by someone who
      exclusively uses a mouse to navigate between form fields and thinks this
      would be helpful to *them*, and by extension to everyone else as nobody
      would ever use a computer in any different way form them.

      The result is an interface that assists the users of mice (and
      presumably other pointing devices) and actively hinders the users of
      keyboards; those of us who can touch-type, serious laptop users (who
      know all the keyboard shortcuts because those laptop pointing devices
      really are not much use for anything) and anyone disabled in such a way
      as to render mouse/pointing device use non-viable while leaving the
      keyboard useable.

      On the other hand the facility might be of value to the users of
      pointing devices. So I wonder whether it could be implemented in a way
      that provided the action for them but did not interfere with keyboard
      users. A possible starting point would be to trigger this "helpful"
      feature only if a pointing device was initially used to focus the first
      telephone field. Monitoring a mousedown or click event on that field, so
      that users who tabbed into the field with the keyboard would not trigger
      the script. Maybe combined with monitoring keydown events on all form
      fields, or at the document level, and aborting all pointing device
      assisting scripts whenever a tab key press was detected. (best of both
      worlds?)

      Richard.


      Comment

      • Andrew Urquhart

        #4
        Re: Help? Need to autotab between fields . . .

        *Richard Cornford* wrote:
        [assistive form-field tabbing discussion]
        [color=blue]
        > On the other hand the facility might be of value to the users of
        > pointing devices. So I wonder whether it could be implemented in a way
        > that provided the action for them but did not interfere with keyboard
        > users. A possible starting point would be to trigger this "helpful"
        > feature only if a pointing device was initially used to focus the
        > first telephone field. Monitoring a mousedown or click event on that
        > field, so that users who tabbed into the field with the keyboard
        > would not trigger the script. Maybe combined with monitoring keydown
        > events on all form fields, or at the document level, and aborting all
        > pointing device assisting scripts whenever a tab key press was
        > detected. (best of both worlds?)[/color]

        Interesting from a theoretical perspective, but pragmatically a
        potential quagmire. In a WWW context I'd still prefer to have a form
        with no surprises. However, it could be very useful in an internal
        application where form completion is a repetitive task and training can
        be given.

        Best,
        --
        Andrew Urquhart
        - FAQ: www.jibbering.com/faq/
        - Archive: www.google.com/groups?q=comp.lang.javascript
        - My reply address is invalid, see www.andrewu.co.uk/contact/


        Comment

        • Matt Kruse

          #5
          Re: Help? Need to autotab between fields . . .

          Richard Cornford wrote:[color=blue]
          > It is one of those requirements that are thought up by someone who
          > exclusively uses a mouse to navigate between form fields and thinks
          > this would be helpful to *them*, and by extension to everyone else as
          > nobody would ever use a computer in any different way form them.[/color]

          Not necessarily true.

          I've encountered this requirements several times, and each time it was to
          make a web-based form match functionality to an old terminal application or
          something. So, users are very used to entering data in a certain way (not
          having to tab between fields) and want to maintain that interface on the web
          form.

          This is why I wrote the solution which still exists at the url below, even
          though the code is old and I usually disagree with the concept even being
          used. For web sites that are open to the public, auto-tabbing is a bad idea,
          IMO.

          --
          Matt Kruse
          Javascript Toolbox: http://www.JavascriptToolbox.com/


          Comment

          Working...