<html>
<head>
<title></title>
<script type="text/javascript">
function data_copy()
{
if(document.form1.copy[0].checked){
document.form1.add12.value=document.form1.add1.value;
document.form1.add22.value=document.form1.add2.value;
document.form1.city2.value=document.form1.city.value;
document.form1.state2.value=document.form1.state.value;
}else{
document.form1.add12.value="";
document.form1.add22.value="";
document.form1.city2.value="";
document.form1.state2.value="";
}
}
</script>
</head>
<body bgcolor="#ffffff" >
<table width='500' border='0' cellspacing='1' cellpadding='0'>
<form name=form1 method=post action='https://www.plus2net.com'>
<tr><td colspan=2><b>Ofice Address</b></td></tr>
<tr><td >Address 1</td><td><input type=text name=add1></td></tr>
<tr><td >Address 2</td><td><input type=text name=add2></td></tr>
<tr><td >City</td><td><input type=text name=city></td></tr>
<tr><td >State</td><td><input type=text name=state></td></tr>
<tr><td >
<b>Residence Address</b></td><td><input type=radio name=copy value='yes' onclick="data_copy()";>Same as above
<input type=radio name=copy value='no' onclick="data_copy()";>Not Same
</td></tr>
<tr><td >Address 1</td><td><input type=text name=add12></td></tr>
<tr><td >Address 2</td><td><input type=text name=add22></td></tr>
<tr><td >City</td><td><input type=text name=city2></td></tr>
<tr><td >State</td><td><input type=text name=state2></td></tr>
<tr><td colspan=2 align=center><input type=submit value=Submit> </form></td></tr>
</table>
</body>
</html>
Event HandlingSelection and copy of all text of textarea
shankar | 03-12-2014 |
The above radio button example is very helpful to understand the onclick event to copy the field values and How, if a table contains radio button and column names in a html form on while loop when a radio button and update command button clicked the second html form should reflect the corresponding fields in the form1. |
sarojini rout | 08-01-2015 |
Thank you so much. |