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?
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.
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!
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?
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
is working on a reply...