Re: The form fields are repeating while implementing marketo form with gatsby at times

Vipin_Mp
Level 2

The form fields are repeating while implementing marketo form with gatsby at times

I am having an issue The form fields are repeating while implementing marketo form with gatsby at times.

Upon inspecting the form i can see its just one form not two

Have anyone faced this issue before? Please suggest some resolutions for this

 

S1 (1).png

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: The form fields are repeating while implementing marketo form with gatsby at times

No link == no way to troubleshoot your code.

Vipin_Mp
Level 2

Re: The form fields are repeating while implementing marketo form with gatsby at times

Please find the link below:

 

https://master.d3hbcbdcrj7dg4.amplifyapp.com/

 

To reproduce the issue easily,  you can switch between pages quickly by clicking links "Go to page 2" (in Page 1) and "Go back to the homepage" (in Page 2).

 

S1.png

SanfordWhiteman
Level 10 - Community Moderator

Re: The form fields are repeating while implementing marketo form with gatsby at times

Right now I see no form at all on the page. I assume you're working on it, which makes troubleshooting impossible.

 

In any case — the cause is almost certainly that you're running loadForm() multiple times by accident, this is the expected behavior when you do that.

Vipin_Mp
Level 2

Re: The form fields are repeating while implementing marketo form with gatsby at times

Hi San,

 

Here it is loading fine. Can you please hard refresh the page?

 

Thanks,

 

Vipin

SanfordWhiteman
Level 10 - Community Moderator

Re: The form fields are repeating while implementing marketo form with gatsby at times

May be fine now, but certainly not when I posted many hours ago.

 

You need to look for multiple calls to loadForm(), as that's always the cause of this behavior. So there's an incorrect condition somewhere in your code — something like a forgetting to flip a flag when a function has already called. But you haven't simplified it enough for 3rd-party debugging.