I want to ask the user if he wants to delete a line from the database, so I proceed like this :
<script>
function show_confirm() {
var x;
if (confirm("Press a button!") == true) {
x = "You pressed OK!";
} else {
x = "You pressed Cancel!";
}
document.getElementById("demo").innerHTML = x;
}
</script>
on the PHP page i call it like this :
print "<a href='http://www.google.com' onclick='return show_confirm();'> Google </a>";
$userAnswer = ???;
How do I know if the user pressed OK or CANCEL? (so that i can do different treatement).
Thanks in advance.