Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MOVE CY TO PY</title>
<script type="text/javascript">
function movecytopy(el){
for (var c, els=el.form.elements, i = els.length-1; i > -1; --i)
if((c=els[i].name)&&/CY$/.test(c))
for (var p, j = els.length-1; j > -1; --j)
if((p=els[j].name)&&c.replace(/CY$/, 'PY')==p)
els[j].value=els[i].value, els[i].value='';
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="button" name="button" id="button" value="MOVE CY TO PY" onclick="movecytopy(this)"></td>
<td> </td>
</tr>
<tr>
<td><input name="example1CY" type="text" id="example1CY" size="15"></td>
<td><input name="example1PY" type="text" id="example1PY" size="15"></td>
</tr>
<tr>
<td><input name="example2CY" type="text" id="example2CY" size="15"></td>
<td><input name="example2PY" type="text" id="example2PY" size="15"></td>
</tr>
<tr>
<td><input name="example3CY" type="text" id="example3CY" size="15"></td>
<td><input name="example3PY" type="text" id="example3PY" size="15"></td>
</tr>
<tr>
<td><input name="example4CY" type="text" id="example4CY" size="15"></td>
<td><input name="example4PY" type="text" id="example4PY" size="15"></td>
</tr>
</table>
</form>
</body>
</html>
Bookmarks