473,395 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
Jul 23 '05 #1
4 1861
*Mike* wrote:
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.


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/
Jul 23 '05 #2
Andrew Urquhart wrote:
<snip>
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 :-)


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.
Jul 23 '05 #3
*Richard Cornford* wrote:
[assistive form-field tabbing discussion]
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?)


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/
Jul 23 '05 #4
Richard Cornford wrote:
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.


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/
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John Pether (john | last post by:
Hi I have a page that displays business listings. I have a repeater with dynamic text and in the 4th column I have an email and website link. Both display properly but I need to have one take...
5
by: David M Loraine | last post by:
I am a sql novice and would appreciate any help with the following problem. In a table I have property addresses stored in 6 fields. Field6 always hold the Post Code. However, fields 4 and 5...
1
by: Julia Briggs | last post by:
Hello, I have these two scripts, where the first one is being canceled out by the second, they work independently, but not together (they are a auto-tab and form box character counter script) --...
2
by: qsweetbee | last post by:
I have a form(fAddUsers) in my database. It is continue form for data entry. Some fields are required fields. Some are optional fields. There is 1 particular filed(TokenExpirationDate)on the form...
9
by: tym | last post by:
HELP!!! I'm going round the twist with this... I have a VB6 application which is using DAO to access a database (Please - no lectures on ADO, I know what I'm doing with DAO!!) Ok, problem...
2
by: Mark | last post by:
I am trying to export an access 2003 query to XML and need to get it to export in a very specific format. I am stuck and could use some help badly (time is critical with this project). This is...
2
by: keithtracypierce | last post by:
1)Access2003, beating my head against the wall, every other iteration is "can't find macro Upshift" followed by carefully verifying that no blank properties have been entered. Making NO changes at...
1
by: darrel | last post by:
Hi vb master i need help on this here my code: If Combo1(0) = rs.Fields("TimeStart") And Combo4(0) = rs.Fields("TimeEnd") And Combo2(0) = rs.Fields("ROOM") And Combo3(0) = rs.Fields("DAYS")...
11
by: troy_lee | last post by:
I have two fields on a form. These two fields' values are based on an expression and represent a date range. I need to create a SQL statement that will use the returned values of these two fields...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.