lolka84 где ваш код?
На вскидку:
<form name="forma">
<input type="text" />
<input type="text" />
</form>
<script type="text/javascript">
window.onload = function(){
var event = ['keyup', 'change'];
for(i=0; i<event.length; i++){
document.forms['forma']['on'+event[i]] = function(i){
return function(){
this.elements[1].value = (this.elements[0].value == '') ? '' : eval(this.elements[0].value);
};
}(i);
}
};
</script>