tags:

views:

24

answers:

0

I create two table. 1 is key in mailing address like mailing street , city and etc. Another table is shipping address and the field is almost same with mailing address. Sometimes, the shipping address is same as the mailing address. How can i just create a radio button and when click it will copy the same think from mailing address to shipping address? And the data which key in by user will save inside the mysql database.

Someone say, its very easy to solve but i cant solve it.

Can anyone show me someway?

<script type="text/javascript">
function data_copy(){
if(document.form1.copy[0].checked){
document.form1.txtmailing_add2.value=document.form1.txtmailing_add1.value;  document.form1.Address.txtother_street.value=document.form1.Address.txtmailing_street.value;
document.form1.Address.txtother_city.value=document.form1.Address.txtmailing_city.value;  document.form1.Address.txtother_state.value=document.form1.Address.txtmailing_state.value;
document.form1.Address.txtother_postcode.value=document.form1.Address.txtmailing_postcode.value;  document.form1.Address.txtother_country.value=document.form1.Address.txtmailing_country.value;
}
else{
 document.form1.Address.txtmailing_add2.value="";
 document.form1.Address.txtother_street.value="";
 document.form1.Address.txtother_city.value="";
 document.form1.Address.txtother_state.value="";
 document.form1.Address.txtother_postcode.value="";
 document.form1.Address.txtother_country.value="";
}}</script>
<form name=form1 method=post action="">

. . .