PDA

View Full Version : Help with forms.


WPiersol
10-06-2005, 08:08 PM
I have a page on my shopping cart that list the customers billing address and a simple form to input the ship to address. I want to have a checkbox for the customer to check if the billing and ship to address are the same. When checked it would automaticly fill in the ship to address. But I can't figure it out with out going to another page when checked. Any ideas?

WPiersol

nikkiH
10-06-2005, 09:26 PM
Use client-side javascript, not server-side ASP, if you want to do it without a server trip.

Bullschmidt
10-13-2005, 06:02 AM
Here's a snippet of JavaScipt code that has worked for me that might get you started:

<script type="text/javascript"> <!--
function jsCopyFields() {
// This function is triggered by Copy Fields button's onclick.

// Dim var.
var frm;

// Form.
frm = document.frmMain

// Set form fld.
frm.LName1.value = frm.LName0.value;
frm.FName1.value = frm.FName0.value;
frm.MName1.value = frm.MName0.value;
frm.Addr11.value = frm.Addr10.value;
frm.Addr21.value = frm.Addr20.value;
frm.City1.value = frm.City0.value;
frm.State1.value = frm.State0.value;
frm.Zip1.value = frm.Zip0.value;
}
//-->
</script>