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

problem in javasrcipt function with asp.net

56
hello everyone,

i m trying to creat a touch screen page in which i have 6 textboxs like

Phone NO: textbox1 - textbox2 - textbox3
Confirm Phone No:textbox4 - textbox5 - textbox6

and 10 buttons with value 0,1,2,3,4,5,6,7,8 and 9 like

Expand|Select|Wrap|Line Numbers
  1.    <table cellspacing="0" style="width: 398px; height: 156px">
  2.                         <tr>
  3.                             <td style="width: 55px" align="center">
  4.                                 <input id="Button1" class="button" type="button" value="1" onclick="add(1)" style="width: 117px; height: 70px" /></td>
  5.                             <td style="width: 10px" align="center">
  6.                                 <input id="Button2" type="button" value="2" onclick="add(2)" style="width: 117px; height: 70px"/></td>
  7.                             <td style="width: 3px" align="center">
  8.                                 <input id="Button3" type="button" value="3" onclick="add(3)" style="width: 117px; height: 70px"/></td>
  9.                         </tr>
  10.                         <tr>
  11.                             <td style="width: 55px" align="center">
  12.                                 <input id="Button4" type="button" value="4" onclick="add(4)" style="width: 117px; height: 70px"/></td>
  13.                             <td style="width: 10px" align="center">
  14.                                 <input id="Button5" type="button" value="5" onclick="add(5)" style="width: 117px; height: 70px"/></td>
  15.                             <td style="width: 3px" align="center">
  16.                                 <input id="Button6" type="button" value="6" onclick="add(6)" style="width: 117px; height: 70px"/></td>
  17.                         </tr>
  18.                         <tr>
  19.                             <td style="width: 55px" align="center">
  20.                                 <input id="Button7" type="button" value="7" onclick="add(7)" style="width: 117px; height: 70px"/></td>
  21.                             <td style="width: 10px" align="center">
  22.                                 <input id="Button8" type="button" value="8" onclick="add(8)" style="width: 117px; height: 70px"/></td>
  23.                             <td style="width: 3px" align="center">
  24.                                 <input id="Button9" type="button" value="9" onclick="add(9)" style="width: 117px; height: 70px"/></td>
  25.                         </tr>
  26.                         <tr>
  27.                             <td style="width: 55px" align="center">
  28.                             </td>
  29.                             <td style="width: 10px" align="center">
  30.                                 <input id="Button10" type="button" value="0" onclick="add(0)" style="width: 117px; height: 70px"/></td>
  31.                             <td style="width: 3px" align="center">
  32.                             </td>
  33.                         </tr>
  34.                     </table>
  35.  
here when i click on 1,2,3...,0 it entered in textbox1,

i want that maxlength on textbox1 is 3 and when it feel with 3 nos then focus goes to textbox2 (maxlength=3) and nos enter into it and when it feel with 3 nos then focus goes to textbox3 and nos enter into it .

i make one javascript function to enter nos in textbox
Expand|Select|Wrap|Line Numbers
  1.  function add(number)
  2.      {
  3.     //if(document.getElementById("no").maxlength < "3")
  4.     {
  5.      document.getElementById("no").value=document.getElementById("no").value + number;
  6.     }    //  no is id of textbox1
  7.  
but i dont known how limite textboxs with 3 nos.

and how to switch on second after entring 3 nos in firsttextbox
how can i do this using javascript
Jan 23 '08 #1
2 1014
mzmishra
390 Expert 256MB
use MaxLength function to set Maximum length of textbox
then u use
document.forms[0].controlID.focus() to change the focus
Jan 23 '08 #2
sejal17
56
use MaxLength function to set Maximum length of textbox
then u use
document.forms[0].controlID.focus() to change the focus
thank you friend,

but i have to make touch screen page. i tried with maxlength propery.but it work only i enter nos using keybord. here i have enter nos using 1,2,3,,,,,and 0 buttons.

when i enter nos using butons it maxlength propery not work.

please help me for this problem.

thanks again.
Jan 23 '08 #3

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

Similar topics

0
by: i.norton | last post by:
Hi, I've been asked by a client to design what is essentially a very large order form which draw it's products from a MySQL db using PHP and then writes them to a table, this i'm fine with. ...
7
by: Emanuel Ziegler | last post by:
Hello, I want to do some mathematics with functions. In my case the function classes are very complex, but this simple example has the same problems. To allow calculations that begin with a...
117
by: Peter Olcott | last post by:
www.halting-problem.com
1
by: Mohamed Fysal | last post by:
I have written a Regular DLL with many Export Functions and one CALLBACK fun ction . The callback function declared in the .cpp file of the Regular DLL is as fol lows: typedef BOOL...
12
by: Joel Byrd | last post by:
I'm having a little problem with using type-ahead functionality for an auto-suggest box. Sometimes, when I start to type something and the type-ahead shows up, the AJAX will send a request query...
2
by: Fernando Barsoba | last post by:
Dear all, I have been posting about a problem trying to encrypt certain data using HMAC-SHA1 functions. I posted that my problem was solved, but unfortunately, I was being overly optimistic. I...
7
by: Trickynick1001 | last post by:
Hi, a newbie here. I don't have a real firm grasp on the idea of Javascript, as I'm used to programming in Qbasic and C. I'm not used to OOP. Anyway, I really don't have any idea what the...
78
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only...
6
by: per9000 | last post by:
An interesting/annoying problem. I created a small example to provoke an exception I keep getting. Basically I have a C-struct (Container) with a function-pointer in it. I perform repeated calls...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
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...
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
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.