Netlify Form Overlap Two Different Website

Hey Folks,

There are multiple deployed websites in Netlify. When I receive data from two different forms, they overlap each other, although they don’t have the same Form Name. I fill the form in exampleA.com, but I receive form data from exampleB.com. Am I missing something else?

Hey there,

First thing’s first, we have a handy form problems Common Issue you may want to check out!

Can you provide us with either site name from the UI for us to help diagnose this?

Thanks for the reply @Pieparker.

Form A here
Site name is: retmes

Form B is here
Site name is: retmon

Hey there!

I’ve tried the forms and I’m not able to replicate the issue! We’re finding the forms on the sites successfully and we’re accurately naming them in a hidden input. Can you give me a particular record that’s causing a problem?

Hello.

I’ve got a new subscribe from this form.

But how can another website’s form fields appear here? It seems empty because there are no fields already, in that form. Other fields, that after the ‘‘Location’’, from another website.

It’s really weird, ha? :smiley:

So, just to clarify and be real clear - you’re saying that you’re submitting the form on https://www.retmes.com/en/iletisim and seeing that data in the Forms section of the web UI for retmon.com?

And vice versa, you’re submitting the form on https://www.retmon.com/en/form/ and seeing that data in the Forms section of the web UI for retmes.com?

Because that’s cray but we can figure it out I’m sure. :sunglasses:


Jon

1 Like

@raufsamestone I see that you ‘liked’ my response but can you please confirm with a message that I’m either describing the situation correctly or not?

Hey @jonsully, I just want to check for last time. So, here is the last status,

  1. Retmon’s form works well, as before.
  2. Submiting Retmes’s form, I receive from fields from Retmon.

Okay, looking at this a bit deeper. I think I have a hunch as to what’s going on.

curl’ing that page directly contains

<form novalidate name='Retmes_Contact' method='post' action='/success' class>
<input type='hidden' name='form-name' value='Retmes_Contact' />

Which appears to be a post-build form that Netlify transformed to remove the data-netlify fields and add the hidden form-name field for. Nice.

But in the DOM, post render / Gatsby ‘stuff’, I see

<form novalidate="" name="Retmes_Contact" method="post" action="/success" class="">

which is very close but I’m presuming that the static form from build-time actually gets removed and this form is a fully separate object just posting to the same place. The one thing you’re missing in this ‘dynamic’ form is the hidden field. Add that exact hidden field to this dynamic form and I bet it’ll work perfect:

<input type='hidden' name='form-name' value='Retmes_Contact' />

Oddly enough, in reviewing your form on the Retmon side, there’s no hidden input there either… so you should add one… but typically I see that forms without that input don’t make it to any form box, let alone cross-wired to a single one. Worth additional digging and sandboxing in an isolated repository or two if adding those two elements to your sites fixes the issue :thinking:

btw: docs for reference, pegged directly at the spot you need(ed) https://docs.netlify.com/forms/setup/#work-with-javascript-rendered-forms

2 Likes

Thank you @jonsully

I added to hidden input field each form. And also I change the form name variable in function just in case, like this:

'form-name': form.getAttribute('name')

It worked! :tada:

Thx again.

Noice! Glad to hear it :sunglasses: :muscle:t2:

Awesome work @jonsully! Thanks so much for jumping in here.

Very glad to hear you’re up and running @raufsamestone :running_man:

1 Like