By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,553 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 17 Nov 2004 10:03:38 -0800, da***@scene-double.co.uk (David) wrote:
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
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


Jul 22 '05 #2

P: n/a
"David" <da***@scene-double.co.uk> wrote in message
news:c1**************************@posting.google.c om...
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)


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.