leon2009sp,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
function names(){
var str = document.getElementById('input_test').value;
var txt = document.getElementById('input_test3').value;
var res = str.replace(/a/gi,"A");
document.getElementById('output').innerHTML = res + txt;
document.getElementById('input_test').value = res;
}
</script>
</head>
<body>
<input id="input_test" oninput="names()" type="text">
<input id="input_test3" oninput="names()" type="text">
<div id=output output2></div>
</body>
</html>