ok show what i do
on Javascript part i write this code
function change_title(obj)
{
document.getElementById('title').value = document.getElementById('select2').options[selected_index].text;}
and on body i write this code
<select name="FileNo" id="select2" onChange="change_title();">
<?
$query="SELECT * FROM pationts";
$result=mysql_query($query) or die("error: " . mysql_error());
while($row=mysql_fetch_array($result))
{
echo "bla";
?>
<option value="<?php echo $row['Name'] ; ?>"><?php echo $row['FileNo'] ; ?></option>
<?
}
?>
</select>
and
<input name="PationtName" type="text" id="title"/>
but not print name of pationt why ??!!!!