Hiding iframe after form fillup

Avatar

Avatar

ihm185

Avatar

ihm185

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

View Entire Topic

Avatar

Avatar

Jean-Serge_Biro

MVP

Avatar

Jean-Serge_Biro

MVP

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