I'm currently working on a project where I need to use Sweetalert 2 to display a confirmation message before submitting a form and also pass a variable from the form to PHP. I have looked through several resources but I haven't found a clear solution for this specific scenario.
Here's what I'm trying to achieve:
I want to display a Sweetalert 2 confirmation box when the user clicks on the submit button of a form. If the user confirms the action, I want to send a specific variable from the form to a PHP script for further processing.
I have already integrated Sweetalert 2 into my project and it works perfectly for displaying simple messages. However, I'm struggling to figure out how to pass the form variable to the PHP script while displaying the Sweetalert 2 pop-up.
I would greatly appreciate if anyone could provide a code example or guide me in the right direction on how to achieve this. Thank you in advance for your help!