SOLVED

Re: grabs the web page the form was filled out on, not overwritten on multiple form submissions

Go to solution
Kevin_Stinson
Level 3

grabs the web page the form was filled out on, not overwritten on multiple form submissions

Hello

I am having an issue where when a form is submitted it is not it does not overwrite the field when the form is filled out the second or third time. It always remains as the first submission.

 

I am using the LastFormURL added through addHiddenFields method that I read about on a nation post:

https://nation.marketo.com/t5/Knowledgebase/How-to-Create-a-Field-That-Grabs-the-Web-Page-the-Form-W...

 

Here is the code that I am using that is added on a non-Marketo page:

MktoForms2.loadForm("//pages.to.xxxxxx.com", "xxx-IAP-xxx", 3341, function(form) {
form.addHiddenFields({ formLastURL : document.location.href })
});

 

The field formLastURL is set Block Updates From: None

 

Hoping for some insight to fix this.

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: grabs the web page the form was filled out on, not overwritten on multiple form submissions

You can see in your F12 Console that the code isn't running, since it depends on the MktoForms2 object (created by forms2.min.js) and you aren't ensuring the correct load order.

2021-01-22 10_55_55-Franklin Global Growth Strategy _ Franklin Templeton — Mozilla Firefox.png

 

View solution in original post

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: grabs the web page the form was filled out on, not overwritten on multiple form submissions

Do you have Pre-Fill enabled for this field? (You shouldn't.)

Kevin_Stinson
Level 3

Re: grabs the web page the form was filled out on, not overwritten on multiple form submissions

@SanfordWhiteman from what I read in the other posts is that the you did not need this form field on the actual form but it was added to the page in the .js script.

 

But I went and added it to the form as a hidden field and set it to Form Pre-fill: Disabled but I am still getting the original page that it was tested on and not the current page I am testing.

SanfordWhiteman
Level 10 - Community Moderator

Re: grabs the web page the form was filled out on, not overwritten on multiple form submissions

You don't need it on the form in Form Editor, that's certainly true. But if it is on the form, you need to make sure the Pre-Fill is disabled.

 

What's the URL of a page w/this form?

Kevin_Stinson
Level 3

Re: grabs the web page the form was filled out on, not overwritten on multiple form submissions

SanfordWhiteman
Level 10 - Community Moderator

Re: grabs the web page the form was filled out on, not overwritten on multiple form submissions

You can see in your F12 Console that the code isn't running, since it depends on the MktoForms2 object (created by forms2.min.js) and you aren't ensuring the correct load order.

2021-01-22 10_55_55-Franklin Global Growth Strategy _ Franklin Templeton — Mozilla Firefox.png

 

Kevin_Stinson
Level 3

Re: grabs the web page the form was filled out on, not overwritten on multiple form submissions

Thanks Sanford I will need to go back to our web team to configure how they load these scripts.

Is there any other method to capture the page URL that the form has been filled out on?

 

SanfordWhiteman
Level 10 - Community Moderator

Re: grabs the web page the form was filled out on, not overwritten on multiple form submissions

No, that's the right code, it just needs to be loaded in the right place.