buttons don't work
buttons don't work
I am new with datatables and I've made it work on my table. My problem is that, I have buttons on my table which works fine before applying datatables. They just don't work now, I know this is really a newbee question, sorry but thanks for any help.
here a code section:
this is a part of the table where the buttons are created:
echo "<td id=\"a\" align=\"center\"><button style=\"align:right;\"type=\"submit\" name=\"view\" class=\"button\">View</button>";
echo "<button type=\"submit\" name=\"update\" class=\"button edit\">Update</button>";
echo "<button type=\"submit\" name=\"delete\" class=\"button delete\" onclick=\"return confirm('Are you sure you want to Edit the Account?');\">Delete</button><hr color=\"#00baff\"></td>";
and this is their somewhat, "action" when clicked:
<?php
if($_SERVER["REQUEST_METHOD"]=='POST'){
if(isset($_POST['view'])){
$key = $_POST['key'];
$_SESSION['patient_id'] = $key;
echo "<script>window.location.href=\"patient_medical.php\";</script>";
}else if(isset($_POST['update'])){
$key = $_POST['key'];
$_SESSION['patient_id'] = $key;
echo "<script>window.location.href=\"patient/update_patient.php\";</script>";
}else{
$key = $_POST['key'];
$_SESSION['patient_id'] = $key;
echo "<script>window.location.href=\"patient/delete_patient.php\";</script>";
}
}
?>
I've been searching around and can't really find an answer, maybe cuz I haven't understood datatables better, I hope somebody enlightens me here. thanks!