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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy info from onefiled to another with checkbox 1

Status
Not open for further replies.

lisege01

Programmer
Nov 18, 2002
6
CA
i need help!
i need to copy info, such as address, from one field to another with the click of a checkbox, rather than have the user re-type it all, if address 2 is the same as address 1, checking off the check box will automatically copy the info over. i haven't been able to locate code for such a thing!

this can be in javascript, activeX,html or vbscript.

any suggestion will be greatly appreciated!

 
<html>
<head>
<title>test</title>
<SCRIPT LANGUAGE=&quot;vbscript&quot;>

Sub chkbox_OnClick
Dim frm
Set frm = Document.form1
address1 = frm.address1.value
If Document.form1.chkbox.checked = true Then
Document.form1.address2.value = address1
Else
Document.form1.address2.value = &quot; &quot;
End If
End Sub




</Script>

</head>
<body>
<body topmargin=&quot;0&quot; leftmargin=&quot;0&quot;>
<Form name=&quot;form1&quot;>
<input type=&quot;text&quot; name=&quot;address1&quot; size=&quot;30&quot; <font size=&quot;2&quot;><br>
<input type=&quot;text&quot; name=&quot;address2&quot; size=&quot;30&quot; <font size=&quot;2&quot;><br>
<input type='checkbox' name='chkbox' value='Click Me'>



</form>
</body>
</html> Regards
Steve Friday
 
hey steve!

thanks for the help! this is great! :)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top