I am trying a method you guys referred me to earlier, and I thought I had it but something doesn't work properly.
I have a form button that I would like to have a confirmation pop up before submit like this:
<input name="delivered_id" type="hidden" value="id21" />
<input type="button" name="deliverconf" value="Deliver" onclick="temp = window.confirm('Confirm Delivery?');">
The confirm message with Ok and Cancel buttons pops up successfully, but is suppose to set the "temp" variable to "true" or "false" once clicked, right?
But when trying this, nothing happens:
<?
if(isset($_POST['deliverconf']))
{
$delivered_id = $_POST['delivered_id'];
echo "$delivered_id";
echo "$temp";
}
?>
The "if(isset($POST['deliverconf']))" doesn't seem to happen after I selected Ok or Cancel.
I also tried "if(isset($POST['temp']))", but nothing.
Why can that be?
Even this does nothing:
<?
if ($temp)
{
echo "$temp";
}
?>
Any suggestions, or a better method to get a confirmation message