I have a custom form in a modal and it is working fine, but I don't want any redirect after submission. Ideally it would be nice to display a message in the modal after submission with a link to close it. But I'd take just having it close, as if the upper right button were clicked. But I need the page it was triggered from to not be reloaded in any way.

When I comment out the ctools_ajax_command_redirect() in my callback, the modal just hangs with the rotating widget never going away. The submission happens meanwhile, but it seems to require a redirection to get beyond that. But the overlays in D7 just go back to the existing page - just what I need.

If version 1.2 is an issue, I can probably get the client to upgrade. Please let me know if I can get the behavior I'm looking for. Thanks for any help.

Comments

kas-1’s picture

Using ctools_modal_command_dismiss() should close the modal without reloading the page. Also, you could use ctools_modal_command_display($title, $body) to replace the form inside the modal with a message. Have you tried either of those commands?

If you want the message to include a link to close the modal, I think you'd need to include a few lines of custom Javascript to call Drupal.CTools.Modal.dismiss() when the link is clicked.

japerry’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing this issue as outdated as Drupal 6 ctools is not supported. If this issue is relevant for Drupal 7, feel free to re-open and mark for Drupal 7 (or 8)