hi guys, i had a problem with my codes, the problem is I cannot delete the inputs in the first 3 fields if I want to delete it.
Here is the code:
[HTML]<head>
<script language="JavaScript">
function switch_next(cur_obj,next){
if(cur_obj.value.length==3)
document.getElementById(next).focus();
}
</script>
</head>
<body>
<form id="myForm">
<input type="text" name="txtTin1" id="txtTin1" value="" size="3" maxlength="3"
onkeydown = "switch_next(this,'txtTin2')" tabindex="1">
<input type="text" name="txtTin2" id="txtTin2" value="" size="3" maxlength="3"
onkeydown = switch_next(this,'txtTin3') tabindex="2">
<input type="text" name="txtTin3" id="txtTin3" value="" size="3" maxlength="3"
onkeydown = switch_next(this,'txtTin4') tabindex="3">
<input type="text" name="txtTin4" id ="txtTin4" value="" size="3" maxlength="3"
tabindex="4">
</form>
</body>
</html>[/HTML]
BEst of luck to all
Regards also.
Thanks :-)
4 1257
Greetings, you just asked a Javascript question in the Java forum. The two have
nothing much in common, despite their names. I'll move your question over to
the Javascript forum (see the blue menu bar near the top of this page and click
'the Forums' item).
kind regards,
Jos
hi guys, i had a problem with my codes, the problem is I cannot delete the inputs in the first 3 fields if I want to delete it.
Here is the code:
[HTML]<head>
<script language="JavaScript">
function switch_next(cur_obj,next){
if(cur_obj.value.length==3)
document.getElementById(next).focus();
}
</script>
</head>
<body>
<form id="myForm">
<input type="text" name="txtTin1" id="txtTin1" value="" size="3" maxlength="3"
onkeydown = "switch_next(this,'txtTin2')" tabindex="1">
<input type="text" name="txtTin2" id="txtTin2" value="" size="3" maxlength="3"
onkeydown = switch_next(this,'txtTin3') tabindex="2">
<input type="text" name="txtTin3" id="txtTin3" value="" size="3" maxlength="3"
onkeydown = switch_next(this,'txtTin4') tabindex="3">
<input type="text" name="txtTin4" id ="txtTin4" value="" size="3" maxlength="3"
tabindex="4">
</form>
</body>
</html>[/HTML]
BEst of luck to all
Regards also.
Thanks :-)
1.) Use code tags everytime when posting code
2.) Java != Javascript
Moved to Javascript forum
hi guys, i had a problem with my codes, the problem is I cannot delete the inputs in the first 3 fields if I want to delete it.
Here is the code: -
<head>
-
<script language="JavaScript">
-
-
function switch_next(cur_obj,next){
-
if(cur_obj.value.length==3)
-
document.getElementById(next).focus();
-
}
-
</script>
-
</head>
-
-
<body>
-
<form id="myForm">
-
<input type="text" name="txtTin1" id="txtTin1" value="" size="3" maxlength="3"
-
-
onkeydown = "switch_next(this,'txtTin2')" tabindex="1">
-
<input type="text" name="txtTin2" id="txtTin2" value="" size="3" maxlength="3"
-
-
onkeydown = switch_next(this,'txtTin3') tabindex="2">
-
<input type="text" name="txtTin3" id="txtTin3" value="" size="3" maxlength="3"
-
-
onkeydown = switch_next(this,'txtTin4') tabindex="3">
-
<input type="text" name="txtTin4" id ="txtTin4" value="" size="3" maxlength="3"
-
-
tabindex="4">
-
</form>
-
</body>
-
-
</html>
-
BEst of luck to all
Regards also.
Thanks :-)
You better to use Code Tags as mentioned at the Right Side of the Page.
You should follow that.
Update the switch_next function. -
function switch_next(e,cur_obj,next){
-
var k = e.which ? e.which : e.keyCode;
-
if(k==8/*Back space*/ || k==46/*Del*/) return;
-
if(cur_obj.value.length==3) document.getElementById(next).focus();
-
}
-
And in HTML also...! -
<input type = text onlcick = switch_next(event,this,next_textbox)>
-
I think it will work fine.
Best of Luck with your try.
Kind regards,
Dmjpro.
You better to use Code Tags as mentioned at the Right Side of the Page.
You should follow that.
Update the switch_next function. -
function switch_next(e,cur_obj,next){
-
var k = e.which ? e.which : e.keyCode;
-
if(k==8/*Back space*/ || k==46/*Del*/) return;
-
if(cur_obj.value.length==3) document.getElementById(next).focus();
-
}
-
And in HTML also...! -
<input type = text onlcick = switch_next(event,this,next_textbox)>
-
I think it will work fine.
Best of Luck with your try.
Kind regards,
Dmjpro.
ah ok, next time, i'll use tags, sorry for that.
by the way, the code already worked,
Thanks for your help. You are guys are so cool!!!
Best of luck to all! :-)
Take care always..
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Brad Eck |
last post by:
"The only operators that cannot be overloaded
are :: (scope resolution), . (member selection), and .* (member
selection through pointer to function). Quoting from Stroustrup's 3rd
edition of _The...
|
by: Stewart Graefner |
last post by:
What do I need to use to be able to make information in a table be
deleteable by a User? The table I have tracks Vacation time. It has two
fields Vacation Dates and Days taken(Default value 0). The...
|
by: MLH |
last post by:
Mr Leigh Purvis gave me a very clever piece of SQL to accomplish what
is probably an uncommon objective. In it, he uses the EXISTS operator.
I can find no documentation on it in A97 HELP. I would...
|
by: hharry |
last post by:
hello all,
i have created a simple web service:
public class ImmediateResponse : System.Web.Services.WebService
{
public ImmediateResponse()
{
}
|
by: subashini Thiyagarajan |
last post by:
hi,
i want to delete a record.hope it is very easy.but same time i want to move the deleted record in to new table for report generation in future.
i succeeded in deleting the record along with...
|
by: streamkid |
last post by:
i have a class table, which has a vector of records(-db). i 'm trying
to remove an element,
but it doesn't seem to work..
i read this http://www.cppreference.com/cppvector/erase.html] and
that's...
|
by: Premal |
last post by:
Hi,
I tried to make delete operator private for my class. Strangely it is
giving me error if I compile that code in VC++.NET. But it compiles
successfully on VC++6.o. Can anybody give me inputs...
|
by: SCPOS |
last post by:
Cannot delete X: It is being used by another person or program. Close any programs that might be using the file and try again.
Of course I have tried closing any programs I know of that may be...
|
by: Stefano Sabatini |
last post by:
Hi all, I'm encountering this while trying to implement a factory
singleton method to generate objects.
The singleton has a static map which binds a static creation function
defined in each...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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: 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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |