Copy data from 1 form text box to another...

D

David

Hi,

I hope this is the correct place for this post. I have also posted to
the JavaScript group.

I have an asp page with a form.
The form has 2 text boxes for entering a serial number range.
first serial & last serial

In a variable on the asp page I have a quantity.
What I want is that when the user enters a serial number in the first
text box and presses the tab key to set focus to the second text box,
I want the second box to copy the first, but to increase by the qty in
my variable

i.e. Text Box 1:
User types: 1104555666 and presses tab

Qty in variable is 10

1104555666 should increase by 10 but include the first, i.e. -1 on the
end.

Text box 2 should then display 1104555675


How is this possible ?

Appreciate your help


David
 
J

Jeff Cochran

Hi,

I hope this is the correct place for this post. I have also posted to
the JavaScript group.

I have an asp page with a form.
The form has 2 text boxes for entering a serial number range.
first serial & last serial

In a variable on the asp page I have a quantity.
What I want is that when the user enters a serial number in the first
text box and presses the tab key to set focus to the second text box,
I want the second box to copy the first, but to increase by the qty in
my variable

You can't do that in ASP. ASP is server-side, so anything you do on
the client, such as change focus, can't be reacted to by ASP.

Javascript (or other client technology) or ASP.NET may help, but not
Classic ASP (This group's focus).

Jeff
 
H

Hal Rosser

David said:
Hi,

I hope this is the correct place for this post. I have also posted to
the JavaScript group.

I have an asp page with a form.
The form has 2 text boxes for entering a serial number range.
first serial & last serial

In a variable on the asp page I have a quantity.
What I want is that when the user enters a serial number in the first
text box and presses the tab key to set focus to the second text box,
I want the second box to copy the first, but to increase by the qty in
my variable

i.e. Text Box 1:
User types: 1104555666 and presses tab

Qty in variable is 10

1104555666 should increase by 10 but include the first, i.e. -1 on the
end.

Text box 2 should then display 1104555675


When your asp creates the web page, let it assign a value to the javascript
variable.
Then use javascript and the onBlur event of the text box to set the value of
the other text box.
ASP can write javascript as well as it can write html -
The ASP executes on the server and sends the html and javascript code to the
browser.
the javascript code gets executed in the browser (client-side)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top