j-iN-uK
03-26-2004, 12:38 PM
Hi,
I have a listbox called LstSchoolName, onChange of the item in the listbox, I want to display, that School details in my textbox. I can do this in javascript, but we are not allowed to use javascript. How can I call an onchange event in php?
$sql = "select * from Table1 where SchoolName like '%".$SchoolName."%' order by SchoolName";
$result = mysql_query($sql);
if($row = mysql_num_rows($result)){
}
else
{
echo ('No Results!');
}
if($row = mysql_num_rows($result)){
?>
<tr>
<td width="2%">Name</td>
<td width="48%"><input type="text" name="txtSchool" size="37" <?if (!empty($SName)){?> value="<?=$SName?>" <?}?> readonly="true"></td>
<?
echo "<TD rowspan=7 height=\"120\"><SELECT NAME=\"LstSchoolName\" ID=\"LstSchoolName\" SIZE=\"8\">\n";
$SName="";
$Code="";
while ( $row = mysql_fetch_array($result) )
{
If ($SName!=$row["SchoolName"])
{
$SName = $row["SchoolName"];
$County = $row["Locality"];
$Street = $row["Street"];
echo "\n<OPTION VALUE='".$row["SchoolName"]."'>".$SName."</OPTION>";
}
}
?>
<tr>
<td width="2%">Address </td>
<td width="48%"><input type="text" name="txtAddr" size="37" <?if (!empty( $Street)){?> value="<?= $Street?>" <?}?> readonly="true"></td>
</tr>
<tr>
<td width="2%">County </td>
<td width="48%"><input type="text" name="txtCounty" <?if (!empty( $County )){?> value="<?= $County ?>" <?}?> size="37" readonly="true"></td>
</tr>
I have a listbox called LstSchoolName, onChange of the item in the listbox, I want to display, that School details in my textbox. I can do this in javascript, but we are not allowed to use javascript. How can I call an onchange event in php?
$sql = "select * from Table1 where SchoolName like '%".$SchoolName."%' order by SchoolName";
$result = mysql_query($sql);
if($row = mysql_num_rows($result)){
}
else
{
echo ('No Results!');
}
if($row = mysql_num_rows($result)){
?>
<tr>
<td width="2%">Name</td>
<td width="48%"><input type="text" name="txtSchool" size="37" <?if (!empty($SName)){?> value="<?=$SName?>" <?}?> readonly="true"></td>
<?
echo "<TD rowspan=7 height=\"120\"><SELECT NAME=\"LstSchoolName\" ID=\"LstSchoolName\" SIZE=\"8\">\n";
$SName="";
$Code="";
while ( $row = mysql_fetch_array($result) )
{
If ($SName!=$row["SchoolName"])
{
$SName = $row["SchoolName"];
$County = $row["Locality"];
$Street = $row["Street"];
echo "\n<OPTION VALUE='".$row["SchoolName"]."'>".$SName."</OPTION>";
}
}
?>
<tr>
<td width="2%">Address </td>
<td width="48%"><input type="text" name="txtAddr" size="37" <?if (!empty( $Street)){?> value="<?= $Street?>" <?}?> readonly="true"></td>
</tr>
<tr>
<td width="2%">County </td>
<td width="48%"><input type="text" name="txtCounty" <?if (!empty( $County )){?> value="<?= $County ?>" <?}?> size="37" readonly="true"></td>
</tr>