Active
Project:
Popups API (Ajax Dialogs) [D7]
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Jan 2009 at 19:35 UTC
Updated:
30 Jan 2009 at 22:30 UTC
Hi, thanks for your module. I have found it very useful. There is one feature I did not see listed and wondered if it is possible "out of the box".
When the page (let's call this page the parent page) with the link to open the popup is clicked, a popup opens and loads a drupal form. This is all fine. Upon submitting that popup form, I would like for the popup to disappear (which it does right now) and the parent page to redirect to another page.
I have no use for the content from the popup form to show on the parent page, I just would rather reload and redirect the parent page.
Any tips would be appreciated. Thanks!
Comments
Comment #1
sirkitree commentedIf you read the README, you will note that if you're using the hook_popups() you can specify the link and an option to go along with it. There is an option called reloadWhenDone that you set to TRUE and this should give you the intended result.
From the README:
Comment #2
elvis2 commentedThanks for the reply. I did read that, but it does not mention a redirect option, just to reload the parent page. Even if I use the hook_popups option, which I am not currently, how can I get popups to tell the parent page to redirect to some other url?
Comment #3
sirkitree commentedAh, I see. Sorry, I misunderstood the original question.
In that case, you can use the afterSubmit option. Set this = to a javascript function name that does your forwarding. See #336063: Add an "afterSubmit" option to hook_popups(). for more details.
Comment #4
starbow commentedsirkitree is right, that is the way to do it right now. It only works in the 6.1 branch, though, not the 6.2 branch.
I am thinking of adding this ability to the forceReturn option. Right now that is just a boolean, but I think it would be useful to have it be 'original' (forceReturn to original page), 'next' (forceReturn to the page returned by the form submit) or 'url:xxxx' (forceReturn to a new url). I still need to think through how it would interact with the other options...if forcing return always does a reload, or if you can do ajax updates from parts of the new page.