Hiding iframe after form fillup

ihm185

09-05-2019

Hello everyone,

We have forms in Adobe campaign instance which are displayed on our company website inside an iframe. is it possible to hide the iframe (like, changing CSS attribute to display:none;) after successful form fillup?

Please share your thoughts.

Kind regards,

Imran

Accepted Solutions (1)

Accepted Solutions (1)

Jean-Serge_Biro

MVP

13-05-2019

Hi Ihmran,

You can do several ways:

In a Script activity:

This way below, no control on the target, _self is used (as for the standard url of an End activity)  so the idea is a page without an iframe:

response.sendRedirect("http://www.yourcompany.com/page_with_no_iframe")

Or a variant I use whenever possible in the company web site, when there are several back-and-forth between the company web site and the webApp and that the company web site can manage URL GET parameters:

I store the web site url in a variable:
ctx.vars.pageRedirection = "http://www.yourcompany.com/page_with_iframe"

then script activity for ending/redirection:

response.sendRedirect(ctx.vars.pageRedirection + "?" + request.queryString)

and so you can add a parameter for indicating to the parent what to do (as not displaying the iframe, reducing the size etc).


The same, but with control on the appearence:

window.open("https://www.yourcompany.com/page_with_no_iframe","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400");

I tried with _parent instead, but I had some issues.

In the factory End activity, by not using the standard Url redirection, you can also place standard html redirection but with very few control on the result, not so good for your use case.

Regards
J-Serge

Answers (4)

Answers (4)

Jean-Serge_Biro

MVP

10-05-2019

Hi ihm,

Very similar situation for me from years.

Our web site is another domain as Adobe Campaign webApps, and many restricting CORS and so on.

We can't manipulate easily Javascript/html open windows parameters (_parent etc).

For example, to enforce the parent page (the website), to change the iframe size or scrollbars under events.

I tried with standard End activity and Javascript httpRequest redirection.

The easiest solution was to redirect to a thank you page managed by the web site, instead of a page of the webApp, and pass it some parameters for the web site instructions.

Probably someone in the community could indicate us some workarounds.


Regards
J-Serge

ihm185

13-05-2019

Thank you J-Serge for replying,

currently, my workaround is :

  • Showing Adobe form via iframe in our companydomain.com
  • The form Workflow has a End activity where I have added a redirect (thank you page residing in companydomain - URL ) via CTA as direct redirects using javascript aren't working.

<p style="color: #FFFFFF;">Please <a style="color:#cee5ff;" href="theurl" target="_top">click here</A> to view the asset.</p>

Regards,

Imran