...

View Full Version : help me here



kamsmartx
05-07-2008, 09:47 AM
There have three files and I have also requested a list when selecting the value of the list must be other values in the print files required Example


<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))
{
echo "???";
?>
<option value="<?php echo $row['PationtName'] ; ?>"><?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="address"/>



when i select from list value , we must print on each filetext value of it >>>who

i can solveed by using java script but it print only for pationtname ???



function change_doctor(ref)
{
document.getElementById('DocName').value = ref;
}

shyam
05-07-2008, 06:15 PM
I assume the values of address and tell are also present in the pationt table...the simplest way to do it is to have a some sort of delimited string for the value


<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"/>
and use


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];
}

kamsmartx
05-07-2008, 06:38 PM
there are wrong !!
when i insert by using above code i go to Data Base and the ther are wrong sort ??

shyam
05-07-2008, 06:47 PM
oops...thats gotta be


var arr = ref.split(/\^/);

kamsmartx
05-07-2008, 08:00 PM
ok
but on data base we print on parentname and address and tell value of pationtname this is wrong

kamsmartx
05-08-2008, 08:18 AM
what can i do

kamsmartx
05-08-2008, 04:12 PM
what >>>>

kamsmartx
05-08-2008, 04:45 PM
what >>>>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum