Auto tab bvetween inputs

This is a discussion on "Auto tab bvetween inputs" within the JavaScript Forum section. This forum, and the thread "Auto tab bvetween inputs are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 29th, 2006, 14:59
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,763
Blog Entries: 1
Thanks: 0
Thanked 18 Times in 18 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Auto tab bvetween inputs

Code: Select all
<HTML>
<head>

<script language="JavaScript"><!--
function KeyPress(what,e,max,action) {
    if (document.layers) {
        if (e.target.value.length >= max)
            eval(action);
    }
    else if (document.all) {
        if (what.value.length > (max-1))
            eval(action);
    }
}
//--></script>

</head>

<body>

<form>

  <input type="text" name="text1" size="1" maxlength="1" onKeyUp="KeyPress(this,event,1,'what.form.text2.focus()')">
- <input type="text" name="text2" size="2" maxlength="2" onKeyUp="KeyPress(this,event,2,'what.form.text3.focus()')">
- <input type="text" name="text3" size="3" maxlength="3" onKeyUp="KeyPress(this,event,3,'what.form.text4.focus()')">
- <input type="text" name="text4" size="4" maxlength="4" onKeyUp="KeyPress(this,event,4,'what.form.text5.focus()')">
- <input type="text" name="text5" size="5" maxlength="5" onKeyUp="KeyPress(this,event,5,'what.form.text6.focus()')">
- <input type="text" name="text6" size="6" maxlength="6" onKeyUp="KeyPress(this,event,5,'what.form.text6.focus()')">
</form>

</body>
</HTML>
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote

  #2 (permalink)  
Old Nov 30th, 2006, 01:35
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Auto tab bvetween inputs

Isn't that what the attribute tabindex is for?
Reply With Quote
Reply

Tags
auto tab

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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Scrolling Div ??? slimboyfatz32 Other Programming Languages 3 May 18th, 2008 17:49
disable two inputs smudge618 JavaScript Forum 2 Feb 7th, 2008 15:24
Only allow two inputs smudge618 JavaScript Forum 2 Feb 5th, 2008 10:55
inputs remembering their input Jaken Veina Web Page Design 2 Apr 25th, 2006 01:50


All times are GMT. The time now is 19:02.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43