Si en el value usas la ID de cada registro es muy facil hacerlo con Javascript
:
Código HTML:
Ver original<input type="text" name="idprof" id="idprof" value="" /><br /> <select name="cprofesor" id="cprofesor" onchange="document.getElementById('idprof).value=this.value;"> <option value="1" selected="selected">Id profesor 1
</option>