CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 copy text from one textbox to another on a form with a button

Print topic Send  topic

Author Message
Chris__T


Posts: 339
Posted: 04/09/2008, 7:18 AM

I'm trying to copy name,address,city,state,zip fields from a set of textboxes to another set of textboxes below them, using a button. I tried to do this in an on-click event, setting the values of the new textboxes to the values of the old textboxes.

form1.Name2textbox.value = form1.name1textbox.value
etc....

but clicking the button doesn't do anything. Any suggestions?
View profile  Send private message
micjon

Posts: 8
Posted: 04/09/2008, 7:47 AM

Be sure you are putting the logic in javascript on the client-side rather than using the server-side event for OnClick.
View profile  Send private message
Chris__T


Posts: 339
Posted: 04/09/2008, 8:05 AM

Ah, ok. I was server side.

Can I set the value of the textboxes the same way I did on server-side? Or is there a special way in javascript? I'm not to familiar with javascript.
View profile  Send private message
mljonzs

Posts: 124
Posted: 04/09/2008, 9:47 AM

There are a couple of ways to do it in javascript.

The easiest way is to use something like:
document.forms["form1"].Name2textbox.value = document.forms["form1"].Name1textbox.value;

Keep in mind that javascript, unlike ASP, is case-sensitive so you need to really be careful

Hope this helps.
_________________
What does not begin WITH God, will end in failure!
View profile  Send private message
Chris__T


Posts: 339
Posted: 04/09/2008, 10:01 AM

Thanks. That helped. I also read through some javascript tutorials online and was able to even append textbox date into one box (like putting first name and last name text boxes into one box) Thanks for your help!
View profile  Send private message
mljonzs

Posts: 124
Posted: 04/10/2008, 10:05 AM

Glad it helped. Some of this stuff can be frustrating at first, but once you get used to it, CCS is really cool and nice to work with.

Good Luck!
_________________
What does not begin WITH God, will end in failure!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.