Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

UserForm in FancyBox - Completion Redirect


Reply

3 Posts   512 Views

Avatar
juneallison

27 September 2013 at 10:04am Community Member, 108 Posts

Hi,

So I have a form created with the UserForm Module that opens in a light box. That part is working fine. After a user fills out the form and hits submit, they get redirected to a different page. I know this is triggered by:
return $this->redirect($this->Link() . 'finished' . $referrer); (Ln 938 of UserDefinedForm.php)

On that "finished" page they see the correct completion message. What I really want to happen is for that completion message to appear inside of the lightbox. Ideally the form would disappear and they would see the completion message.

Any suggestions on how to go about this would be great.

Thank you!

June

Avatar
Willr

28 September 2013 at 5:07pm Forum Moderator, 5511 Posts

You'll need to submit the form in the popup through javascript and load the resulting page. A plugin like http://malsup.com/jquery/form/ gives a clean way to submit the form and handle the result.

Avatar
juneallison

1 October 2013 at 2:34am Community Member, 108 Posts

Willr - Excellent! Thank you for your reply. I'll give this a try. Since my original post, I did discover that if I set fancybox's content type to iframe I get the entire sequence (form > success message) within the popover, but I would prefer to make the ajax version work.

Thanks for your help!