English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Separated by a vertical line or bar.


The input box itself must be submitted as one value,
but the 7 digits of an account need to be physically separated in the textbox.

This is so that the user enters each number of the account into a separate box.

2006-08-17 23:47:10 · 3 answers · asked by tjhauck2001 2 in Computers & Internet Programming & Design

3 answers

This is possible. But you have to do some java scripting to update the text box each time a user enters a value. You can try the “onChange” event of the text box to do so. It is difficult to display the entire code here. So you can try the following links and get to know about how the JavaScript and text box working. Then you can develop your own JavaScript code for this.

2006-08-18 00:19:34 · answer #1 · answered by Nishan Saliya 4 · 1 0

There are a couple ways of handling this.

One, which has a certain drawback, it put them all in one text field and write an onchange handler. The drawbacks with this are that it might not get invoked until the user leaves the field.

Another approach would be to write an onsubmit handler for the form, create separate adjacent text fields to get the data from and combine them into one field (perhaps in a hidden field), and submit that to the server by calling submit off the form object after making the change.

Neither of these event handlers seem to quite fit the requirements, as they are stated.

Handling the onkeypress event might be best. See W3 website for details and test your code in both browsers.

By the way, the new 5th edition of "JavaScript: The Definitive Guide" just came out in August 2006.

It provides information on the latest JavaScript 1.6 techniques which you can use in Firefox 1.5 and later, as well as compatibility information for older browsers that use JavaScript 1.3, such as the venerable IE 6.0 web browser.

In addition to that stuff, I think you will find information about writing your own event handlers in it. They are described in the 4th edition, which I have.

2006-08-18 07:30:28 · answer #2 · answered by John C 5 · 1 0

I think it can be possible if you use underscore like 9_2_blah blah

2006-08-18 07:15:21 · answer #3 · answered by 0_0 4 · 0 1

fedest.com, questions and answers