Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Best way to show a confirmation dialog (popup)?

businessdadbusinessdad Stealth contributor MVP
edited July 2012 in Vanilla 2.0 - 2.8

I'm implementing a delete feature in one of my plugins, and I'd like to ask for confirmation before deleting anything. On the backend the logic is relatively simple:
- Show a page with the list of elements.
- User clicks on Delete next to an element. When the request arrives the first time, show the confirmation page.
- When User clicks on OK on the confirmation page, send the same request with a "confirm=1" in the URL, which means delete and return to the list page.

All the above can work relatively nicely as-is. When User clicks on Delete, the confirmation dialog is nothing else than a normal page, rendered via a standard view. However, I think it would be nicer to simply show a small popup confirmation dialog (when JavaScript is enabled, of course).

Any suggestion in implementing this would be very welcome.

Comments

  • peregrineperegrine MVP
    edited July 2012

    maybe

    applications/dashboard/controllers/class.entrycontroller.php can give you some ideas.

    or the ignore and ignoreuser plugins have popups with forms.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • businessdadbusinessdad Stealth contributor MVP

    @peregrine Thanks, I hope I won't get lost in all the files. :)

  • peregrineperegrine MVP
    edited July 2012

    I think this is the case for you -
    http://www.brainyquote.com/quotes/quotes/d/danielboon142243.html

    I have never been lost, but I will admit to being confused for several weeks.
    Daniel Boon

    except in your case several minutes.

    I'd love to see your plugins and app if you ever want to share just for persual.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • businessdadbusinessdad Stealth contributor MVP

    The application is "just" a fairly standard forum, where the most difficult tasks were the integration with the abomination called Magento (the more I use it, the more I hate it) and the implementation of a "vBulletin-style" theme. Thanks to @mcu_hq for creating the Traditional Chocolate, which I used as a base for what I could call Lemon Sorbet theme (it's almost completely white, as per Client specifications).

    So far I have four plugins "cooking", with an idea for a fifth which will act as a "support" for the others; it will mainly contain validation functions that don't exist in Vanilla Core and that I keep using over and over.

    To this, add all the work to make the plugins manageable by Continuous Integration systems, the development of Magento Modules (specifically, one to integrate with Vanilla JsConnect) and some more stuff. As my protegé says, I have plenty to give to the industry, I should update my blog more often! :)

  • what's your site again?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.