473,386 Members | 1,706 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,386 software developers and data experts.

focus change

smiley22
i have 3 textfield..
what i wan to do do is when the first textfield was input with 3 numbers
the cursor will be on the second textfield and when the secong textfield was
input with 3 numbers the cursor will be on the 3rd textfiled.


your replies will be very appreciated.

thanks and more power to you all guys!!

regards and godbless. :)
Aug 28 '07 #1
5 1674
dmjpro
2,476 2GB
i have 3 textfield..
what i wan to do do is when the first textfield was input with 3 numbers
the cursor will be on the second textfield and when the secong textfield was
input with 3 numbers the cursor will be on the 3rd textfiled.


your replies will be very appreciated.

thanks and more power to you all guys!!

regards and godbless. :)
It would be better if you posted some code.
Anyway next time try to send some code.
Please try some code then come here with your specific problem.
You can capture the event by using...!
Expand|Select|Wrap|Line Numbers
  1. <input type = text onkeypress = call_func()>
  2.  
Please try this code and try to write the call_func by own.
Best of luck with that.

Kind regards,
Dmjpro.
Aug 28 '07 #2
acoder
16,027 Expert Mod 8TB
i have 3 textfield..
what i wan to do do is when the first textfield was input with 3 numbers
the cursor will be on the second textfield and when the secong textfield was
input with 3 numbers the cursor will be on the 3rd textfiled.
Check this example out.
Aug 28 '07 #3
i had tried that example, but i got an errors. which says:

'can't move focus because it is invisible, not enable, or of a type that does not accept the focus.'

and the focus was focus with the other buttons in my form.

what could be its cause? im stucked with this scenario.

thanks for your help..
Aug 28 '07 #4
dmjpro
2,476 2GB
i had tried that example, but i got an errors. which says:

'can't move focus because it is invisible, not enable, or of a type that does not accept the focus.'

and the focus was focus with the other buttons in my form.

what could be its cause? im stucked with this scenario.

thanks for your help..
Ok try this code.

Expand|Select|Wrap|Line Numbers
  1. <input type=text id = text1 onkeypress=switch_next(this,'text2')>
  2. <input type=text id = text2 onkeypress=switch_next(this,'text3')>
  3. <input type=text id = text3>
  4.  
Expand|Select|Wrap|Line Numbers
  1. function switch_next(cur_obj,next)
  2. {
  3. if(cur_obj.value.length==3) document.getElementById(next).focus();
  4. }
  5.  
Best of luck with your code.

Kind regards,
Dmjpro.
Aug 28 '07 #5
Ok try this code.

Expand|Select|Wrap|Line Numbers
  1. <input type=text id = text1 onkeypress=switch_next(this,'text2')>
  2. <input type=text id = text2 onkeypress=switch_next(this,'text3')>
  3. <input type=text id = text3>
  4.  
Expand|Select|Wrap|Line Numbers
  1. function switch_next(cur_obj,next)
  2. {
  3. if(cur_obj.value.length==3) document.getElementById(next).focus();
  4. }
  5.  
Best of luck with your code.

Kind regards,
Dmjpro.



>>smiley22

hi guys!!

i had made it! thanks for your help!!

really appreciate it!

regards to all! and gudluck... ;-)
Aug 28 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Roger Withnell | last post by:
Tearing hair out time! Simple attached page shows the problem. http://www.brilley.co.uk/TestFocusSelect.htm Using a function to test if too many characters have been keyed in to a textarea....
3
by: VA | last post by:
t=document.getElementById('mytable') is a HTML table with some input fields in its cells Why doesnt t.getElementsByTagName('tr').firstChild.focus; put the focus on that text field? It...
17
by: Neil Ginsberg | last post by:
OK, this is a stupid thing, but I can't seem to get this to work. I have a form with a subform (in continuous form view). A combo box on the main form has code in the AfterUpdate event which adds a...
4
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several...
3
by: jab3 | last post by:
Hello. I"m new to this group, and to JavaScript in general, so please forgive me if I breach local etiquette. I'm trying to implement some client-side 'dynamic' validation on a form. I'm having...
4
by: Jon Slaughter | last post by:
I've created some custom controls and forms that allow the feature to temporarily transfer focus to a control that has been entered by the mouse. Everything seems to work fine but the problem I...
8
by: makunag | last post by:
Didn't get answer with google and in my regular forum. Came across this site and posting here. Your help will be highly appreciated ! Our application have frames - MainNav, TaskNave and Content....
3
by: viral123 | last post by:
Hi all, does any one know how to get the functionality of get focus and lost focus using ASP.Net like VB.Net I want to change the textbox back ground color when it has the focus. I used...
5
by: Matt B | last post by:
I know this is a bit of nonstandard behavior, but I would like the Enter key to move focus through a group of radiobuttons without selecting them. The user would then have to use Space or actually...
2
by: Jonathan N. Little | last post by:
As part of a JavaScript precheck form validation I noticed a problem with trying to return focus to the field with an error. I have setup a demo page. ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.