Here is my attempt at getting this working. So far no luck.
I'm just gonna post the relevant code.
<script>
function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;
try{
xmlhttp=new XMLHttpRequest();
}
catch(e) {
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
xmlhttp=false;
}
}
}
return xmlhttp;
}
function searchDate(strURL) {
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
document.getElementById('recordTable').innerHTML=req.responseText;
} else {
alert("An error occurred:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
</script>
<form action="" method="post">
<p>Date:<input type="date" name="selectedDate" size="10" />
<input type="submit" name="submit[searchDate]" value="Recherche" onclick="searchDate('planification.php?selectedDate='+document.getElementById('selectedDate').value)" style="margin-right: 25%;" />
<div id="recordTable">
</div>
planification.php
$stmt->bind_param("s",$selectedDate);
$stmt->execute();
//variables are binded and displayed in the same order as the select query
$stmt->bind_result($a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m, $n, $o);
$planificationTable = '<table border="1"><th>a</th><th>b</th><th>c</th>
<th>d</th><th>e</th><th>f</th><th>g</th><th>h</th><th>i</th>
<th>j</th><th>k</th><th>l</th><th>m</th><th>n</th>
<th>o</th>';
while($stmt->fetch())
$planificationTable .= '<tr><td>' . $a . '</td><td>' . $b . '</td><td>' . $c . '</td><td>' . $d . '</td>
<td>' . $e . '</td><td>' . $f . '</td><td>' . $g . '</td><td>' . $h . '</td><td>' . $i . '</td>
<td>' . $j . '</td><td>' . $k . '</td><td>' . $l . '</td><td>' . $m . '</td><td>' . $n . '</td>
<td>' . $o . '</td></tr>';
$planificationTable .= '</table>';
print $planificationTable;