Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving data from one text box to another - easy one : ) 1

Status
Not open for further replies.

missangie

Technical User
Nov 3, 2002
51
I know this is an easy one but I don't remember what the script is anymore. I want to move data from one textbox to another in the same form with a button. The second box will also have other information in it as well. ex. blah blah blah "text box info" blah blah blah.

Thanks in advance!
Angie
 
Have a look at this you should be able to tweek it for your purpose
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script>
function duplicate(){
document.forms.form1.textfield2.value = document.forms.form1.textfield1.value
}
</script>
</head>

<body>
<p>&nbsp;</p>
<form name="form1" method="post" action="">
  <p>
    <input type="text" name="textfield1">
</p>
  <p>
    <input type="text" name="textfield2">
</p>
  <p>
    <input type="button" name="Button" value="Duplicate" onClick="duplicate()">
  </p>
</form>
</body>
</html>

Cheech

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top