473,395 Members | 1,656 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.

TAB / MOVE FOCUS

I have a SSN Field which include 3 text boxes. How do I move the focus from
one box to another as soon as user enter the max characters in the text box.
For example:
when users enter 123 in the first text box of ssn
control should move to next text box .....

-Thanks
Jay
Aug 22 '05 #1
2 4354
"Jay Villa" <ja******@community.nospam> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
I have a SSN Field which include 3 text boxes. How do I move the focus from one box to another as soon as user enter the max characters in the text box. For example:
when users enter 123 in the first text box of ssn
control should move to next text box .....

-Thanks
Jay


This isn't an ASP (server-side) question.

Here's a client-side JavaScript solution:

<form>
<input type="text" name="ssn1" id="ssn1"
size="3" maxlength="3"
onkeyup="if (this.value.length == 3)
document.getElementById('ssn2').focus();">
<input type="text" name="ssn2" id="ssn2"
size="2" maxlength="2"
onkeyup="if (this.value.length == 2)
document.getElementById('ssn3').focus();">
<input type="text" name="ssn3" id="ssn3"
size="4" maxlength="4"
onkeyup="if (this.value.length == 4)
document.getElementById('butt').focus();">
<input type="button" name="butt" value="">
</form>
Aug 22 '05 #2
Thanks McKirahan

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Er********************@comcast.com...
"Jay Villa" <ja******@community.nospam> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
I have a SSN Field which include 3 text boxes. How do I move the focus

from
one box to another as soon as user enter the max characters in the text

box.
For example:
when users enter 123 in the first text box of ssn
control should move to next text box .....

-Thanks
Jay


This isn't an ASP (server-side) question.

Here's a client-side JavaScript solution:

<form>
<input type="text" name="ssn1" id="ssn1"
size="3" maxlength="3"
onkeyup="if (this.value.length == 3)
document.getElementById('ssn2').focus();">
<input type="text" name="ssn2" id="ssn2"
size="2" maxlength="2"
onkeyup="if (this.value.length == 2)
document.getElementById('ssn3').focus();">
<input type="text" name="ssn3" id="ssn3"
size="4" maxlength="4"
onkeyup="if (this.value.length == 4)
document.getElementById('butt').focus();">
<input type="button" name="butt" value="">
</form>

Aug 22 '05 #3

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

Similar topics

4
by: Vincent Yang | last post by:
I'm using Access 2002. My database is in Access 2000 format. I'm designing a form to collect responses to a 40-item questionnaire. I can fit four list boxes on a screen, so I plan to have 11 tab...
4
by: MLH | last post by:
HelpBox is a textbox control on a form. When line #254 is processed, the focus is on HelpBox. However, when line #254 executes, the error saying 'can't move focus to ButtonG' is returned. I've...
6
by: (Pete Cresswell) | last post by:
I *know* I've seen this before but can't remember where. Got a subform - pretty simple, actually. It's lined to a work table that contains comments related to a mutual fund. No problem...
0
by: Ryan Liu | last post by:
After a tree node is clicked in a treeview, I'd like to move the focus to a rich text box(call it rt) next to it. How I can I do it? I tried to call rt.focus() in afterSelect, MouseUp ..etc...
7
by: Seash | last post by:
Hi friends , here is the sample code private void txtbox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if(e.KeyChar == 13) //enter { txtbox2.Focus(); }
0
by: Mynfred | last post by:
Hi, all, I found a strange question about OCX in VB.net, the OCX is crearted by VC++.net, and I put it on the VB.net Form, in OCX, there are many edit box, on the VB.net form, there are many...
1
by: Heather Crow | last post by:
I have a VS.NET 2003 Visual Basic form which keeps hanging. It does not appear to matter what textbox I am on. When trying to edit the field I cannot move focus from this field to another. Clicking...
1
by: patskinny | last post by:
I have a combo box in which a user can select a number of "1" or "0". if the user selects "1" it changes the visible property on other controls that were initial set to "Flase" to "True" . the...
1
by: Doug | last post by:
Hi I havent done much C# for a while and i have forgotten some elements. Could you please let me know how to move the focus or cursor from one text box to another? I have a button on a form...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.