help sort
Posted: Wed May 07, 2008 12:50 pm
hi
i hve this code , this code is sort data to data base , but when i select valuse form list print value of other filed ,,,
but the wrong is :--
when i dislpy data i see on file address , tell , pationtname ,the value "pationtname " why !!!
we must print on address, tell , pationtname value of each
i hve this code , this code is sort data to data base , but when i select valuse form list print value of other filed ,,,
but the wrong is :--
when i dislpy data i see on file address , tell , pationtname ,the value "pationtname " why !!!
we must print on address, tell , pationtname value of each
Code: Select all
<select name="FileNO" onChange="change_pationt(this.value);">
<?
$query="SELECT * FROM pationt";
$result=mysql_query($query) or die("error: " . mysql_error());
while($row=mysql_fetch_array($result))
{
?>
<option value="<?php echo $row['PationtName'] . '^' . $row['address'] . '^' . $row['tell']; ?>"><?php echo $row['PNO'] ; ?></option>
<?
}
?>
</select>
<input name="PationtName" type="text" id="PationtName"/>
<input name="address" type="text" id="address"/>
<input name="tell" type="text" id="tell"/>
Code: Select all
function change_doctor(ref) {
var arr = ref.split(/^/);
document.getElementById('PationtName').value = arr[0];
document.getElementById('address').value = arr[1];
document.getElementById('tell').value = arr[2];
}