If it is at runtime (without reloading the page) it is best to use JQuery:
<script>
jQuery(document).ready(function () {
jQuery('#idCampoOrigem').blur(function () {
jQuery('#idCampoDestino').val(jQuery('#idCampoOrigem').val());
});
});
</script>