473,402 Members | 2,050 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,402 software developers and data experts.

How To Carry Over Text Values (Simple Solution?)

chunk1978
224 100+
hi there... i'm trying to make one text field contain the value of another... i'm assuming there's a really simple solution... here's a code i quickly wrote to further explain my issue:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  5. <title>Untitled Document</title>
  6. </head>
  7. <script type="text/javascript">
  8.  
  9. function Carry
  10.     {document.form1.textfield2.value = document.form1.textfield.value;}
  11.  
  12. </script>
  13.  
  14. <body>
  15. <form id="form1" name="form1" method="post" action="">
  16. <p>
  17.   <input name="submit" type="button" id="submit" value="Carry Over Value" onclick="Carry();" />
  18. </p>
  19. <p>
  20.   <input name="textfield" id="textfield" type="text" value="Duplicate me!" />
  21.   <input name="textfield2" id="textfield2" input type="text" value="Erase me!"/>
  22. </form>
  23. <p>&nbsp;</p>
  24. </body>
  25. </html>
  26.  
thanks in advance! :-)
Feb 20 '07 #1
3 2134
chunk1978
224 100+
oh... i forgot the "()" at the end of the JS function... but still, the result is the same [still doesn't work] when added...
Feb 20 '07 #2
chunk1978
224 100+
nevermind... seems to be working now (???)...

dumb...
Feb 20 '07 #3
acoder
16,027 Expert Mod 8TB
I know it was only an example, but you shouldn't use 'submit' for a normal button to avoid confusion.
Feb 20 '07 #4

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

Similar topics

9
by: fleemo17 | last post by:
I'm hoping a CSS guru can help me with what seems like a simple enough goal. What I'm going for is a large photo centered in the browser with text positioned on top of it. Using the CSS below,...
2
by: Almir | last post by:
I have a simple problem, i just can get a grasp on it. I designed a database for inventory of computer equipment. Now i created forms for each table. Each piece of equipment is going to come in an...
2
by: Paul Malcomson | last post by:
Hi. I'm having terrible trouble with a form that displays several parent/child relationships at one time. It is a sales force hierarchy - Sales force, district, territory, sales rep are the...
16
by: archilleswaterland | last post by:
Hi, I am using a compiler that does not support long int (32 bits) so I am using 2 int's to do the work my problem int a; int b; int c;
6
by: Lelle | last post by:
Hello ! how can i insert text containg code examples from a textbox into a database using SQL insert statment. i have no problem to just add text that dont contains code and script examples...
7
by: gordon | last post by:
Hi, I have a series of forms that collect information from a user. When I write out my information to a text file after the last file, the values of the previous forms seem to be blank. I would...
1
by: Prabhudhas Peter | last post by:
Hello, Need an easy way to Display the property values of an object (dynamically) ie I need to show the values of an Object in a rich text box. Background : We have a form, with a rich...
5
by: campbellbrian2001 | last post by:
I'm trying to get the "Carry data over to new record" code to work from Allen Browne's site: http://allenbrowne.com/ser-24.html I follwed the instruction explicitly and somethings not working......
7
by: Phuff | last post by:
Apparently if you have any duplicates in your Value collection the selected index that is maintained through the state defaults to the first index in that group of duplicates. So my items...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.