Hi
I have a form that has a drop down menu with dates in it.
The form has a submit button.
I would like to submit the selection from the drop-down list and run a select against my database and dsiplay the results.
I when I clik submit , nothing happens..all I see is "error on page' on the task bar.
Help?
Here is my code:
First page conv.php
function submitFunction {
document.maniform.action ="Convhtml.php";
document.mainform.submit()
}
<form action="" method="get" name="mainform">
<table width="488" border="1">
<caption>
<span class="style1"> Select the Report Options </span>
</caption>
<tr>
<td width="233">Setect Start Date
<select name="Datesel" id="Datesel">
<option value="S" selected ="selected">SelStarate</option>
<?php
$db = mysql_connect("server","user","id")
or die("001 - Connection Failed");
mysql_select_db("iapr", $db);
$result = mysql_query("select distinct convocation_year from tbl_degree_cube_calendar_heads ", $db);
while ($myrow = mysql_fetch_array($result))
{
printf("<option>%s</option>\n",$myrow["convocation_year"]);
}
?>
<td><input type="button" name="Button" onClick="submitFunction()" value="Button"></td>
=========================================================
Convhtml.php
<TD><?php
{
$db = mysql_connect("server","user","id")
or die("001 - Connection Failed");
mysql_select_db("iapr", $db);
$result = mysql_query("select faculty from tbl_degree_cube_calendar_heads where
convocation_year = '$Datesel'", $db);
$loop_ind = ($myrow = mysql_fetch_array($result));
printf("<strong>Department: </strong> %s", $myrow["faculty"]);
}
?>
</TD>
I have a form that has a drop down menu with dates in it.
The form has a submit button.
I would like to submit the selection from the drop-down list and run a select against my database and dsiplay the results.
I when I clik submit , nothing happens..all I see is "error on page' on the task bar.
Help?
Here is my code:
First page conv.php
function submitFunction {
document.maniform.action ="Convhtml.php";
document.mainform.submit()
}
<form action="" method="get" name="mainform">
<table width="488" border="1">
<caption>
<span class="style1"> Select the Report Options </span>
</caption>
<tr>
<td width="233">Setect Start Date
<select name="Datesel" id="Datesel">
<option value="S" selected ="selected">SelStarate</option>
<?php
$db = mysql_connect("server","user","id")
or die("001 - Connection Failed");
mysql_select_db("iapr", $db);
$result = mysql_query("select distinct convocation_year from tbl_degree_cube_calendar_heads ", $db);
while ($myrow = mysql_fetch_array($result))
{
printf("<option>%s</option>\n",$myrow["convocation_year"]);
}
?>
<td><input type="button" name="Button" onClick="submitFunction()" value="Button"></td>
=========================================================
Convhtml.php
<TD><?php
{
$db = mysql_connect("server","user","id")
or die("001 - Connection Failed");
mysql_select_db("iapr", $db);
$result = mysql_query("select faculty from tbl_degree_cube_calendar_heads where
convocation_year = '$Datesel'", $db);
$loop_ind = ($myrow = mysql_fetch_array($result));
printf("<strong>Department: </strong> %s", $myrow["faculty"]);
}
?>
</TD>