Open colinmackinlay opened 8 years ago
Put more simply. Consider this example in a form that posts back to its own page:
<input name="testing" type="submit" class="button small expand alert" value="Delete all data!" data-confirm/> <?php if (isset($_POST['testing'])) echo "testing"; ?>
Nothing gets printed out by the php echo
<input name="testing" type="submit" class="button small expand alert" value="Delete all data!" data-confirm="Testing"/> <?php if (isset($_POST['testing'])) echo "testing"; ?>
This uses the windows fallback and the php echo outputs testing
Hi, great plugin - works so easily.
I often have a number of submit buttons that call the same page which then reads for their POST variable names to determine the right action to take. For example I'm trying to use this on a page where two options are:
form action='/pageref.php' method='post'> input name="delete" type="submit" class="button small expand alert" value="Delete all data!" data-confirm/> input name="download" type="submit" class="button small expand success" value="Download all data as CSV"> /form>
pageref.php checks for these with:
if (isset($_POST['delete])) { ... } if (isset($_POST['download])) { ... }
The trouble I'm having is that inserting the data-confirm gives the expected modal dialogue box but when pageref is called the $_POST['delete'] has been lost so I can't confirm the button was pressed. It's become a bit too safe!
Am I missing something obvious or is this a limitation - I could call a different page with this button as a workaround and after performing the action set the headers to the page I want it to go to I suppose.
PS If I use data-value="Do you really want to do this?" so that it uses the window dialogue then the POST variables are set correctly