
October 20th, 2003, 10:50 AM
|
|
Contributing User
|
|
Join Date: Apr 2003
Location: Shimonoseki / JAPAN
Posts: 58
Time spent in forums: 4 m 4 sec
Reputation Power: 6
|
|
Here is the code. tested and verified
unchecking the box will empty the second address fields.
I don't know if there is easier way to do this, I am not an expert, yet
PHP Code:
<%@LANGUAGE="VBSCRIPT"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=1252">
</head>
<script language="JavaScript" type="text/JavaScript">
function copyaddr()
{
if(document.form1.check.checked==true){
document.form1.addressB1.value = document.form1.addressA1.value
document.form1.addressB2.value = document.form1.addressA2.value
document.form1.addressB3.value = document.form1.addressA3.value
}
if(document.form1.check.checked==false){
document.form1.addressB1.value = ""
document.form1.addressB2.value = ""
document.form1.addressB3.value = ""
}
}
</script>
<body>
<form action="/action.asp" name="form1">
<input name="addressA1" type="text"><BR>
<input name="addressA2" type="text"><BR>
<input name="addressA3" type="text"><BR><BR>
same address?<input name="check" type="checkbox" value="usesame" onClick="copyaddr()"><BR>
<input name="addressB1" type="text"><BR>
<input name="addressB2" type="text"><BR>
<input name="addressB3" type="text"><BR>
<input name="" type="submit"><input name="" type="reset">
</form>
</body>
</html>
cheers
__________________
Sweet smell of a great sorrow lies over the land. Plumes of smoke rise, merge into the leaden sky. A man lies and dreams of green fields and rivers, but awakes to a morning with no reason for waking. He's haunted by the memory of lost paradise. In his youth or dream, he can't be precise. He's chained forever to a world that's departed. It's not enough, it's not enough.
Gilmour
|