Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > TAB / MOVE FOCUS

Reply
Thread Tools

TAB / MOVE FOCUS

 
 
Jay Villa
Guest
Posts: n/a
 
      08-22-2005
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


 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      08-22-2005
"Jay Villa" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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>


 
Reply With Quote
 
 
 
 
Jay Villa
Guest
Posts: n/a
 
      08-22-2005
Thanks McKirahan

"McKirahan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Jay Villa" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing move constructors and move assignment Andrew Tomazos C++ 2 12-12-2011 01:45 PM
Firefox keystroke Shorcut: Move focus to next tab - Does it exist ? Al Dykes Firefox 6 12-09-2007 12:11 AM
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
How do I move from tab to tab? Bobby Firefox 11 12-21-2005 03:04 PM
I am trying to move spaces to a weblistbox and when I move them... Eduardo78 ASP .Net Web Controls 0 11-03-2005 06:06 PM



Advertisments