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

sirkitree’s picture

If 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:

reloadWhenDone: Force the entire page to reload after the popup form is submitted (Default: FALSE)

elvis2’s picture

Thanks 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?

sirkitree’s picture

Ah, 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.

starbow’s picture

sirkitree 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.