Confirmation alerts done with JS/AJAX (delete confirmation page and any others)
ChrisBryant - January 31, 2007 - 11:57
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | javascript |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | alert, modal dialog, popup, Usability |
Jump to:
Description
It would improve the content management UI/workflow if pages such as the node deletion confirmation page (node/#/delete) used a simple Javascript alert box or AJAX update to allow the deletion of the page without having to go to a separate page. This could apply to any confirmation type of page as long as it didn't include too much text for the alert.
Your thoughts?
Chris
(PS, I searched the issue queue and didn't find anything matching)

#1
How would you get this to degrade gracefully if the user does not have JS?
#2
How about if the current system were kept intact, have the javascript catch the "Delete" or whatever button requires confirming, ask for confirmation, and then insert the appropriate form elements required for confirming the form directly into the DOM tree before submitting the form.
Just a quick thought, and not sure what else would need to be considered, however it would perform exactly as it does currently if javascript was disabled.
#3
As far as I know this is how the FiveStar module works. When JS is enabled a script is executed to replace standard form with JS-based UI. I believe JS confirmations could work in a similar way.
Also, it would be even better if the implementation was flexible enough so that standard JS confirm function could be easily replaced with other JS handler (if anyone wants to use custom JS dialogs for instance).
Regards,
Bartek
#4
This will be a great usability improvement, but won't happen in 6.x, moving the issue to 7.x
#5
I'd like to reactivate this issue, and propose jQuery Alerts or something similar in functionality as a possible interface for improving the standard JS confirm function etc. jQuery Alerts is themeable with CSS, and is released under the GPL, so seems ideally adapted to our needs.
I have already proposed that jQuery Alerts be added to jQuery plugins: #365474: Add jQuery Alerts plugin. Once that happens, or by applying the patch yourself, you can then see how this kind of functionality would look in Contrib Toggle v1.3. In that case it is not necessary to include separate functionality for browsers without javascript since the entire module's functionality relies on javascript. However, it does not seem likely to be difficult to implement what is described above.
#6
Sounds a lot like #193311: Ajax Popups in Drupal 7: Adding Modal Dialogs to Help, Confirmations and Filter tips (Unified)
#7
I have rolled this functionality into #374646: Popbox (Popups Lite): Adding Modal Dialogs to Confirmations
#8
Thanks for the link, good work and hopefully we can see this make it into Drupal 7. It will be a nice usability improvement.