So I decided to use this plugin https://github.com/Ifnot/PopConfirm as it was recommended as a good confirm button. I have it set up and all working well, except for one thing.
I validate all my forms in PHP using the name of the button clicked since I have several buttons such as save, cancel, delete. Therefore when a form is submitted in PHP the POST variables available to me are these below and I can validate the button using
PHP e.g.
Array ( [supplier] => "david" [customer] => "new buy" [save] => )
Validate Using
if(isset($_POST['save'])){}
But when I use the popconfirm plugin, and since it uses the .submit() to submit the form, on form submission I only get the values of the input box but not the name of the button
Using popconfirm to submit the form, I end up with
Array ( [supplier] => "david" [customer] => "new buy" )
Since the $_POST['save'] is missing when using popconfirm, I therefore can not validate which button was pressed in PHP as it is not passed on.
I can see the plugin uses
form.submit();
to submit the form, but what I can not figure out is why is the name of the button not also being posted like how PHP does it or how to get the submit function to also pass on the button name variable