Hiding iframe after form fillup | Community
Skip to main content
Level 3
May 9, 2019 8:39 AM UTC
Solved

Hiding iframe after form fillup

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Jean-Serge_Biro
Jean-Serge_BiroAccepted solution
Level 10
May 13, 2019 11:08 AM UTC

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

5 replies

Jean-Serge_Biro
Jean-Serge_BiroAccepted solution
Level 10
May 13, 2019 11:08 AM UTC

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

Translate
ihm185Author
Level 3
May 13, 2019 10:45 AM UTC

Hi Jon,

our forms are created in adobe campaign. We have a CMS where we use an iframe to show adobe forms.

Thanks,

Imran

Translate
ihm185Author
Level 3
May 13, 2019 10:38 AM UTC

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

Translate
Jean-Serge_Biro
Level 10
May 10, 2019 2:23 PM UTC

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

Translate
Jonathon_wodnicki
New Participant
May 9, 2019 3:01 PM UTC

Hi,

The iframe is in the Adobe Campaign form, i.e. <input type="urlViewer"/>?

Thanks,

-Jon

Translate