Difficulties proceeding after modal option was selected

Hello community,

I have a problem understanding how jQuery works when offering two options to select from. Currently I am in the process of jquery’ing some php code where user interaction is involved. Let me give you an example:

Let’s say I want a user to confirm deleting an item form a db table. With php I build a form with a hidden tag (say “confirmDelete” = ‘1’), reload the page, look if $_GET[‘confirmDelete’] or $_POST[‘confirmDelete’] == ‘1’ and finally run my query (“DELETE FROM $table bla…”).

Now, while I am able to build a nice pop-up with jQuery UI asking if the user really wants to delete some item, I still don’t get the point how to continue. I miss the code between confirmation and db query. In other words: How do “return” to my php code with the post or get var “confirmDelete” set to ‘1’?

Any hint, link oder code sample is highly appreciated.

Thank you,
Wolfgang (jquery newbee, obviously)

You need to add a click event to the button in your dialog that either adds the hidden variable to the page, or updates the value of the existing hidden field. Then you need to call the submit() event on the form so it posts back.