I have a form where I want that when typing an item number in an input, the description belonging to that item appears in a select.
The item and the description are from a table in MySQL.
I've been researching and I only see solutions in reverse.
This is the code I have so far:
<script>
window.onload = function(){
document.getElementById('ITEM').onchange = function(){
var c = document.getElementById('ITEM').value;
document.getElementById('DESCRIPCION').innerHTML = c;
}
}
</script>
<form>
<tr>
<td width="100" align="right"><font face="arial" size="-1"><b>ITEM</b></font></td>
<td><input type="number" name="ITEM" id="ITEM" style="width:100px;" autocomplete="off" value="<?php echo $fila['ITEM']; ?>"/></td>
</tr>
<tr>
<td> </td>
<td rowspan="3"><textarea name="DESCRIPCION" id="DESCRIPCION" cols="45" rows="3" style="width:350px;" readonly="readonly"><?php echo $fila['DESCRIPCION']; ?></textarea></td>
</tr>
<tr>
<td width="100" align="right"><font face="arial" size="-1"><b>DESCRIPCION</b></font></td>
</tr>
<form>