How do you populate billing address with information from the same page with a button?

This is an asp page. Using html, javascript and asp.
On this page I collect address information, Street, City, State, Zip. Later down the page I have where you put in your credit card information. Does anyone have sample code where I can click a button that says 'Same as Personal Information' and it would populate card Street, City, state, Zip with the information they already entered?

Also the cardname is one field, I would need it to combine the first  and last names from the earlier up the page.


<!-- Name from the personal info -->
<tr valign="bottom">
<td class="bluetxt">First Name*</td>
<td><input name="FirstName" value="<%Response.Write request.form("FirstName")%>" type="text" id="Text3"></td>
</tr>
 
<tr valign="bottom">
<td class="bluetxt">Last Name*</td>
<td><input name="LastName" value="<%Response.Write request.form("LastName")%>" type="text" id="Text4"></td>
</tr>
 
<!-- Street and city from the personal info -->
<tr valign="bottom">
<td><nobr><font color=""#ff0000"">Street* </font></nobr>
</td>
<td valign="bottom" colspan="2">
<input name="Address1" value="<%Response.Write request.form("Address1")%>" type="text" id="Text12" size="30">
</td>
 
<tr valign="bottom">
<td><font color=""#ff0000"">City*</font></td>
<td colspan="2">
<input name="AddressCity" value="<%Response.Write request.form("AddressCity")%>" type="text" id="Text15" size="30"></td>
</tr>
 
 
<!-- Name, CardStreet and City from later in the page -->
<TR>
<td width="126" height="30">
<b>Name on card:</b>
</td>
<td height="30">
<input type="text" value="" name="cardName" size="20" maxlength=20>
</td>
</TR>
<TR>
<td width="126" height="30">
<b>Street:</b>
</td>
<td height="30">
<input type="text" value="" name="CardStreet" size="15" maxlength=50>
</td>
</TR>
							
<TR>
<td width="126" height="30">
<b>City:</b>
</td>
<td height="30">
<input type="text" value="" name="CardCity" size="15" maxlength=50>
</td>
</TR>

Open in new window

seahawk9Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hieloCommented:
try something like the attached script. You just need to add whiever fields you need to "transfer" from the top to the bottom:
<script>
function transferInfo(o)
{
	if( o.checked)
	{
		var f = o.form;
		f.CardStreet.value = f.Address1.value;
		f.CardCity.value = f.AddressCity.value;
		
	}
}
</script>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hieloCommented:
BTW, the checkbox would be:
<input type="checkbox" name="billing" value="sameaspersonal" onclick="transferInfo(this)"/>Same as personal info

Open in new window

0
hieloCommented:
glad to help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.