Hola niltza.
Prueba esto:
Código PHP:
<html>
<head>
<script language='javascript'>
var aCodes = new Array(1, 3, 5, 6, 8);
var aNames = new Array("Yo", "Tu", "El", "Nosotros", "Ustedes");
function showName(val){
document.frm.txt.value = aNames[val];
}
</script>
</head>
<body>
<form name='frm'>
<select name='sel' onchange='showName(this.selectedIndex - 1)'>
<option value=""> </option>
<script language='javascript'>
for (var i = 0; i < aCodes.length; i++)
document.writeln('<option value="' + aCodes[i] + '">' + aCodes[i] + '</option>');
</script>
</select>
<input type='text' name='txt'>
</form>
</body>
</html>
Saludos.