F.eks. sådan, hvor forsendelses-adressen altid vil stå i de 3 felter delAddress1, 2 og 3 (tre for at en evt. att. kan stå i linje to !-)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html,body{height:100%;margin:10px;border:0px;padding:0px;font-family:tahoma,verdana,arial,sans-serif;font-size:small;}
.formtabel{border-collapse:collapse;}
.formtabel td{width:200px;vertical-align:top;}
.formtabel .txtInput{width:190px;}
div.txtInput{background:#ddd;margin:3px 0;line-height:1.5em;}
</style>
<script language="javascript" type="text/javascript">
function altAddress(elm,state){
var f = elm.form;
if(state){
f.delAddress1.value = "";
f.delAddress3.value = "";
}else{
f.delAddress1.value = f.address.value;
f.delAddress3.value = f.zipCity.value;
}
f.delAddress2.value = "";
document.getElementById('delAddressShow').style.display = state ? 'none' : 'block';
document.getElementById('delAddress').style.display = state ? 'block' : 'none';
}
function copyTxt(elm){
var f = elm.form;
var addrField = elm.name=='zipCity' ? f.delAddress3 : f.delAddress1;
var addrShow = elm.name=='zipCity' ? document.getElementById('showDelAddress3') : document.getElementById('showDelAddress1');
addrField.value = elm.value;
addrShow.innerHTML = elm.value;
}
</script>
<title>Send-formular</title>
</head>
<body>
<h4>Oplysniger om køber og forsendelsesadresse:</h4>
<form>
<table class="formtabel">
<tr>
<td>
Navn:</td>
<td>
<input type="text" name="navn" class="txtInput"></td>
</tr>
<tr>
<td>
Adresse:</td>
<td>
<input type="text" name="address" class="txtInput" onkeyup="copyTxt(this);"></td>
</tr>
<tr>
<td>
Postnr. og by:</td>
<td>
<input type="text" name="zipCity" class="txtInput" onkeyup="copyTxt(this);"></td>
</tr>
<tr>
<td>
Samme leveringsadresse som ovenstående?</td>
<td>
Ja: <input type="radio" name="delivery" checked onclick="altAddress(this,false)">
Nej: <input type="radio" name="delivery" onclick="altAddress(this,true)"></td>
</tr>
<tr>
<td>
Leveringsadresse:</td>
<td>
<div id="delAddress" style="display:none;">
<input type="text" name="delAddress1" class="txtInput"><br>
<input type="text" name="delAddress2" class="txtInput"><br>
<input type="text" name="delAddress3" class="txtInput">
</div>
<div id="delAddressShow" style="display:block;">
<div id="showDelAddress1" class="txtInput"> </div>
<div id="showDelAddress2" class="txtInput"> </div>
<div id="showDelAddress3" class="txtInput"> </div>
</div></td>
</tr>
</table>
</form>
</body>
</html>