Two forms, one page?

Hi my netlify form responses are received empty,

Also i receive an empty mail

here is the code,

<form name="join-Prabhat" method="POST" data-netlify="true" data-netlify-recaptcha="true"
                        action="/register/thank-you/">
                        <div class="form-group">
                            <label>Name of the Parent</label>
                            <input type="text" class="form-control" name="Name of the Parent"
                                placeholder="Enter Parent's name" aria-label="Name of the Parent" required>
                        </div>
                        <div class="form-group">
                            <label>Name of the Student</label>
                            <input type="text" class="form-control" name="Name of the Student"
                                placeholder="Enter student's name" aria-label="Name of the Student" required>
                        </div>
                        <div class="form-group">
                            <label>Institution branch area</label>
                            <input type="text" class="form-control" name="Institution branch area"
                                placeholder="Enter Institution branch area" aria-label="Institution branch area"
                                required>
                        </div>
                        <div class="form-group">
                            <label>Contact #</label>
                            <input type="tel" class="form-control" name="Contact #"
                                placeholder="your 10 digit mobile no." minlength="10" maxlength="10"
                                autocomplete="off" aria-label="Contact number" required>
                        </div>
                        <div class="form-group">
                            <label>Email</label>
                            <input type="email" class="form-control" name="Email id" placeholder="abc@somemail.com"
                                aria-label="e_mail_address" autocomplete="off" required>
                        </div>
                        <div class="form-group">
                            <label>Profession</label>
                            <input type="text" class="form-control" name="Profession"
                                placeholder="Enter your Profession" aria-label="Profession" required>
                        </div>
                        <div class="form-group">
                            <label>Select course</label>
                            <select class="form-control" name="course" aria-label="select course" required="">
                                <option value="Bharatanatyam Dance">Bharatanatyam Dance</option>
                                <option value="Kathak Dance">Kathak Dance</option>
                                <option value="Karnatic Music">Karnatic Music</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label>Message</label>
                            <textarea class="form-control" name="Message" placeholder="Enter your message" rows="3"
                                aria-label="message" spellcheck="false" required></textarea>
                        </div>
                        <div data-netlify-recaptcha="true" class="mb-3"></div>
                        <input type="submit" class="btn btn-info1" value="Submit" aria-label="Submit button">
                    </form>

Before doing the below changes it was fine

  1. Added google conversion, analytics and adsense codes
  2. Connected a custom thank you page

Page link of form

Someone, kindly help me

Thanks

Hello @TenSketch, it looks like the name attributes you gave your input fields have spaces in them. You’ll want to make sure that they don’t have spaces. Once you do that, I think things should work.

That’s not the issue, u meant the

name=“Institution_branch_area”

instead of,

name=“Institution branch area”

right?

In my contact form, I have spaces in name fields but it works, but still, I tried removing spaces and added _ but doesn’t work.

Hi @TenSketch, you should only have a single form using the name join_Prabhat. In your built site do you have multiple html files with a form named join_Prabhat? Or do you have any single file with multiple forms named join_Prabhat? This is across all branches. If you define a form named join_Prabhat in production and in staging, and your most recent staging deploy has different field values, then it will overwrite the form definition for production until your next production deploy.

i have one form name

join_Prabhat

and another named

join-Prabhat

the 2nd one I’m not using it and mentioned anywhere else, and I’m also not able to delete the 2nd form from netlify dashboard. And it didn’t bother at all!

only the first form is in use!

@TenSketch you have am index.html in /register-form and another index.html in /register, both of these files have forms named join_Prabhat . Can you rename both of these forms so they have unique names then redeploy so we can see which one of them is causing you trouble?

yeah I found it in public directory, deleted the public and generated again and now it is only one

join_Prabhat, but still responses are not fine

Our system is still seeing a form definition without any fields. Could you please check ALL of your files, after building locally, for a second .html file with a form called join_Prabhat without any fields mentioned? Pretty sure there’s one in there somewhere!

I see the correct form at that URL (/join-prabhat/register-form), so I think once you find and remove the other one, things will work better.

In the public folder, there is only one .html file with the form join_Prabhat

image

In the dashboard, I have another form in a different name which I had b4 but now not able to delete, but that’s not the issue because its a different form name

image

here is the repo, can you check and let me know, thanks
https://github.com/TenSketch/Prabhat.git

The other form would not related; we index by name.

We won’t remove a form from your dashboard that was previously deployed unless you ask, even if you make one or one hundred later deploys without it, so that remaining is expected but again not related to things not working with the join_Prabhat form.

Your current deploy has NO form with that name - I just downloaded it and looked.

So I think the problem is that you deployed it once awhile ago in an html file, and that is the definition your current javascript submission uses. Please create an explicit, separate, html file with the definition including all fields that might be submitted via your javascript submission.

I don’t understand, what should I change in the new file? A new form name or any other change in the form code?

You can try a new form name but you need to make sure that the html that contains your form code is included in your publish directory.

u mean the public directory in the rook folder right when u type ‘hugo’ in cmd

Right, for hugo, your static html form will need to either exist in your public/ folder or in your static/ folder (which gets included in your public/ folder at build time.

i changed the form name, removed public folder and generated again, still receiving empty form only. :frowning:
for now, i’m using formspree plugin

Perhaps you had two separate copies of the form with the same name, and one was empty? That would certainly create problems.

Anyway, glad to hear you found a workaround!

Hi friends,

The form is working fine now.

The solution to this issue:
Removed one form from the page (2nd one was the contact form in the footer) and the 1st form (join-Prabhat) worked. As I had already guessed that

Netlify doesn’t accept 2 forms in one page (https://community.netlify.com/t/2-forms-in-one-page-doesnt-work/6201)

Thank you all for your time. Its a bug to be reported to netlify. How to report it? and there has to be delete option for unused forms from the dashboard as it causes confusion.

hi @TenSketch, if you can tell us the name of your form, we can delete it for you. At the moment, it is not possible for you to delete a form through the UI (we are working on this, but don’t have a timeline for implementation)

Hi,

these are the 2 forms to be deleted,

join_Prabhat

and

join-Prabhat

Hi, I have the same problem with 2 forms and almost broke my head trying to resolve it but as I see now it is still WIP from Netlify’s side.

On the other hand, my main form is not obtaining the data in forms report and just shows blanks even though forms gets submitted and one point I think it even worked too prior to me getting into this whole issue and starting messing with code (even though my footer subscriptions works perfectly and code’s are exactly the same)

Anyone can have a look at why my code wouldn’t obtain the data:

            <form action="POST" data-netlify="true">
              <hr>
              <div class="row">
                <div class="col-md-6">
                  <div class="form-group">
                    <input type="text" class="form-control" placeholder="First Name">
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <input type="text" class="form-control" placeholder="Last Name">
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <input type="text" class="form-control" placeholder="Email">
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <input type="text" class="form-control" placeholder="Phone Number">
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-md-12">
                  <div class="form-group">
                    <textarea class="form-control" placeholder="Message"></textarea>
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-group">
                    <div data-netlify-recaptcha="true"></div>
                    <input type="submit" value="Submit" class="btn btn-outline-danger btn-block">
                  </div>
                </div>
              </div>
            </form>

This one is footer that is perfectly working:

Our Newsletter

Enter Your Email Below: