Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steve Crook 20 posts 131 karma points
    Oct 18, 2021 @ 08:43
    Steve Crook
    0

    Forms in iframes

    Hi all,

    I've recently upgraded from Umbraco Forms 8.3.4 to 8.8.0. I have some forms which I need to have in iframes, because they need to appear on non-Umbraco sites (which will be migrated soon).

    To make this work, I've got the EnableAntiForgeryToken setting set to false in UmbracoForms.config. My forms are set up to display a message on submit, rather than redirect to another page. This all worked in 8.3.4, however in 8.8.0 the message doesn't display and the empty form is just shown again. The form submits successfully and I can see the entry. When I test the form on its own, not in an iframe, everything works - which makes me think it might be an issue with the anti-forgery token.

    Is there something I can do to make my forms work in iframes again?

    Thanks!

  • Steve Crook 20 posts 131 karma points
    Oct 19, 2021 @ 02:18
    Steve Crook
    0

    I've just downgraded to 8.7.6 and it's working again. Is it possible that the fix for this issue has broken something?

  • Andy Butland 410 posts 2298 karma points MVP 4x hq c-trib
    Apr 07, 2022 @ 08:28
    Andy Butland
    0

    I just came across this, but yes, does look like something changed in that version that has caused issues for forms hosted in IFRAMEs.

    Specifically the issue you linked to, where we've moved to ensuring a "post/redirect/get" for form submissions. We then use a TempData value so the page displayed after form submissions "knows" which form has been submitted, and will display the message rather than the empty form.

    But from some testing I can see that for some reason that TempData value isn't persisted when the page is hosted in an IFRAME.

    Have created this issue to track this, and will look at adding a configurable option for using a querystring to indicate which form has been submitted, that can be used in scenarios like this were the TempData value doesn't work.

    Andy

Please Sign in or register to post replies

Write your reply to:

Draft