SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2007
    0 Post(s)
    0 Thread(s)

    Question 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)

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    154 Post(s)
    0 Thread(s)
    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts