473,587 Members | 2,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cannot delete inputs

smiley22
54 New Member
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="JavaS cript">

function switch_next(cur _obj,next){
if(cur_obj.valu e.length==3)
document.getEle mentById(next). focus();
}
</script>
</head>

<body>
<form id="myForm">
<input type="text" name="txtTin1" id="txtTin1" value="" size="3" maxlength="3"

onkeydown = "switch_next(th is,'txtTin2')" tabindex="1">
<input type="text" name="txtTin2" id="txtTin2" value="" size="3" maxlength="3"

onkeydown = switch_next(thi s,'txtTin3') tabindex="2">
<input type="text" name="txtTin3" id="txtTin3" value="" size="3" maxlength="3"

onkeydown = switch_next(thi s,'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 :-)
Aug 29 '07 #1
4 1267
JosAH
11,448 Recognized Expert MVP
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
Aug 29 '07 #2
r035198x
13,262 MVP
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="JavaS cript">

function switch_next(cur _obj,next){
if(cur_obj.valu e.length==3)
document.getEle mentById(next). focus();
}
</script>
</head>

<body>
<form id="myForm">
<input type="text" name="txtTin1" id="txtTin1" value="" size="3" maxlength="3"

onkeydown = "switch_next(th is,'txtTin2')" tabindex="1">
<input type="text" name="txtTin2" id="txtTin2" value="" size="3" maxlength="3"

onkeydown = switch_next(thi s,'txtTin3') tabindex="2">
<input type="text" name="txtTin3" id="txtTin3" value="" size="3" maxlength="3"

onkeydown = switch_next(thi s,'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
Aug 29 '07 #3
dmjpro
2,476 Top Contributor
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:
Expand|Select|Wrap|Line Numbers
  1. <head>
  2. <script language="JavaScript">
  3.  
  4. function switch_next(cur_obj,next){
  5.     if(cur_obj.value.length==3) 
  6.         document.getElementById(next).focus();
  7. }
  8. </script>
  9. </head>
  10.  
  11. <body>
  12. <form id="myForm">
  13.     <input type="text" name="txtTin1" id="txtTin1" value="" size="3" maxlength="3"  
  14.  
  15. onkeydown = "switch_next(this,'txtTin2')" tabindex="1">
  16.     <input type="text" name="txtTin2" id="txtTin2" value="" size="3" maxlength="3" 
  17.  
  18. onkeydown = switch_next(this,'txtTin3') tabindex="2">
  19.     <input type="text" name="txtTin3"  id="txtTin3" value="" size="3" maxlength="3" 
  20.  
  21. onkeydown = switch_next(this,'txtTin4') tabindex="3">
  22.     <input type="text" name="txtTin4" id ="txtTin4" value="" size="3" maxlength="3" 
  23.  
  24. tabindex="4">
  25. </form>
  26. </body>
  27.  
  28. </html>
  29.  
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.
Expand|Select|Wrap|Line Numbers
  1. function switch_next(e,cur_obj,next){
  2.         var k = e.which ? e.which : e.keyCode;
  3.         if(k==8/*Back space*/ || k==46/*Del*/) return;
  4.     if(cur_obj.value.length==3) document.getElementById(next).focus();
  5. }
  6.  
And in HTML also...!

Expand|Select|Wrap|Line Numbers
  1. <input type = text onlcick = switch_next(event,this,next_textbox)>
  2.  
I think it will work fine.
Best of Luck with your try.

Kind regards,
Dmjpro.
Aug 29 '07 #4
smiley22
54 New Member
You better to use Code Tags as mentioned at the Right Side of the Page.
You should follow that.
Update the switch_next function.
Expand|Select|Wrap|Line Numbers
  1. function switch_next(e,cur_obj,next){
  2.         var k = e.which ? e.which : e.keyCode;
  3.         if(k==8/*Back space*/ || k==46/*Del*/) return;
  4.     if(cur_obj.value.length==3) document.getElementById(next).focus();
  5. }
  6.  
And in HTML also...!

Expand|Select|Wrap|Line Numbers
  1. <input type = text onlcick = switch_next(event,this,next_textbox)>
  2.  
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..
Aug 29 '07 #5

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

Similar topics

20
37365
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 C++ Programming Language_, section 11.2 (page 263), these three operators 'take a name, rather than a value, as their second operand and provide the primary means of referring to members. Allowing them to be overloaded would lead to subtleties.'"...
3
2014
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 Form used has four rows of the above for each month of the year. The clerk inputs the vacation dates and the days of vacation time remaining are tallied at the bottom of the form. There are inexcess of 200 hundred employees. Rather than have the...
15
1902
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 like to read more about this useful SQL operator. Suggestions? SELECT CustID, OutType, EXISTS (SELECT CustID FROM tblCorrespondence AS tblC WHERE tblC.CustID = tblCorrespondence.CustID AND tblC.OutType = "01")
0
995
by: hharry | last post by:
hello all, i have created a simple web service: public class ImmediateResponse : System.Web.Services.WebService { public ImmediateResponse() { }
2
1711
subashini Thiyagarajan
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 timely inputs and saved in a different table. but now i want to save the deleted record with extra coulms and delete it i mean removing from display. Any one help me.
5
12027
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 the function i 've written: void table::delel( int index ) { vector< record >::iterator rm = db.begin(); for( int i = 0; i < index; i++ )
12
2553
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 about it. I wanted that on my class delete should not work. Object pointer should be deleted using my function only which is taking care of reference count for particular class. Thanx in advance for your inputs.
2
14995
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 using the file (used X because the filename does not matter...it is a specific log file name to the application). I am logged onto a Windows Server 2003 computer that acts as a server for a LAN, but is physically joined to a domain. The local...
8
20409
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 class to the type of the object to be created. Here it is the code, which is a modification of the wikipedia C++ factory example code: ----------------------------------8<--------------------------------
0
7923
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7852
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
7974
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6629
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.