Jump to:

10848 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » UserForm in FancyBox - Completion Redirect

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 353 Views
  • juneallison
    Avatar
    Community Member
    108 Posts

    UserForm in FancyBox - Completion Redirect Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: UserForm in FancyBox - Completion Redirect Link to this post

    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.

  • juneallison
    Avatar
    Community Member
    108 Posts

    Re: UserForm in FancyBox - Completion Redirect Link to this post

    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!

    353 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.