Re: What javascript code to execute form submission actions from iframe

Anonymous
Not applicable

What javascript code to execute form submission actions from iframe

I've built a landing page which includes a Marketo form (1.0 not a 2.0 form).

  • On the homepage of my site, the user will see a popup window
  • In the popup window is where my Martkeo landing page/form will display

Once the user submits the form, I would like the popup window to close and have the user remain on the homepage.

Have any of you experienced this situation?


I've created a javascript tag and placed it on my landing page.

<script> MktoForms2.whenReady(function (form) { form.onSuccess(function (values, url) { window.parent.location.assign(url); return false; }); }); </script>

It's not working. What am I missing?

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: What javascript code to execute form submission actions from iframe

You can't use MlktoForms2 on a 1.0 form.

I recommend converting to 2.0 and then I can help.

Anonymous
Not applicable

Re: What javascript code to execute form submission actions from iframe

I'd like to keep it as a form 1.0 for now due to time constraints.

Any ideas on a javascript code to perform my action?

Josh_Hill13
Level 10 - Champion Alumni

Re: What javascript code to execute form submission actions from iframe

I suspect that creating a Form 2.0 version will take less time than coming up with new code.