hi..
i'm using js to submit the form that i have,
my php code is
Code:
for($i=0; $i<$period; $i++)
{
print "<form name= \"bookAppointment$i\" id= \"bookAppointment\" action= \"../action/bookAppointment.php\" method= \"GET\">";
print "<tr>";
print "<td class= \"textCenter\">";
print $time;
print "</td>";
$query_view_appointment= "select a.appId, a.timeFrom, s.sname, p.pname, ata.appTypeName, asa.appStatName";
$query_view_appointment2 =" where a.staffId='$staffId' and a.staffId=s.staffId and a.date= '$date' and a.timeFrom ='$time' and a.patientId=p.patientId and a.appStatId=asa.appStatId and a.appTypeId=ata.appTypeId";
$query_view_appointment.= $query_view_appointment1.$query_view_appointment2;
$result= safe_query($query_view_appointment);
while (list($appId, $timeFrom, $sname, $pname, $appTypeName, $appStatName)= mysql_fetch_array($result))
{
print "<td class= \"textCenter\">";
?>
<a href= "staff.php?staffId=<?php echo $sname?>"><?php echo $sname ?></a>
<?php
print "</td>";
print "<td class= \"textCenter\">";
?>
<a href= "patient.php?patientId=<?php echo $patientId?>"><?php echo $pname ?></a>
<?php
print "</td>";
print "<td class= \"textCenter\">";
print $appTypeName;
print "</td>";
print "<td class= \"textCenter\">";
print "<select name= \"appStatName\" class= \"textBox\">";
$result_app_stat = safe_query("SELECT appStatName FROM appointment_status");
while (list($appStatName1)= mysql_fetch_array($result_app_stat))
{
print "<option name= \"$appStatName1\" value= \"$appStatName1\">$appStatName1</option>";
}
print "</select>";
print "</td>";
print "<td class= \"textCenter\">";
print "<input type= \"hidden\" name= \"staffId\" value= \"$staffId\">";
print "<input type= \"hidden\" name= \"patientId\" value= \"$patientId\">";
print "<input type= \"hidden\" name= \"date\" value= \"$date\">";
print "<input type= \"hidden\" name= \"time\" value= \"$time\">";
print "<input type= \"hidden\" name= \"page\" value= \"changeStatus\">";
print "<a href= \"javascript: submitForm()\"> Change </a> ";
print "</td>";
}
print "</tr>";
print "</form>";
}
i don't know what's wrong with this code, but the javascript doesn't work..
this is my js code:
Code:
function submitForm()
{
document.getElementbyID("form").submit();
}
can anyone help me with this?
thank's alot for your attention..
|