A ver si este te sirve:
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <script type="text/javascript"> function igual() {
var ape1 = document.getElementById("ap1").value ;
document.getElementById("ap2").value = ape1 ;
}
<form id="iguales" method="post" action="#"> <input type="text" name="ap1" id="ap1" onkeyup="igual()" /> <input type="text" name="ap2" id="ap2"/>
Saludos