Empty forms (that were working)

Hi everyone

My site contrafoque.com has a contact page that used to work fine since August. Yesterday I received a blank form submission, without any content. I’ve moved the contact form to a different URL and renamed also the form name.

You can check or try it here:

I reviewed the support guide but I can’t find what is now wrong. It’s a plain HTML form with a honeypot and three inputs, all pretty simple. This is the code after removing the CSS classes for an easier read:

<form class="font-serif" 
    name="contact-page" method="POST" 
    data-netlify="true" netlify-honeypot="alternate-name"
    action="/contacto/ok/">

    <div class="">
        <label class="" for="formName">🙇 Nombre</label>
        <input type="text" class="" id="formName" name="name">
    </div>

    <div class="">
        <label class="" for="formEmail">📧 Correo (sólo si quieres que te conteste)</label>
        <input type="text" class="" id="formEmail" name="email">
    </div>

    <div class="">
        <label class="" for="formTextArea">😀 Cuéntame cosas</label>
        <textarea rows="3" class="" id="formTextArea" name="whatsup"></textarea>
    </div>

    <div class="pot">
        <label>No rellenes esto salvo que no seas un humano: <input name="alternate-name" /></label>
    </div>

    <div class="">
        <button class="" type="submit">
            Enviar
        </button>
    </div>

</form>
  • It gets rendered properly as the documentation explains.
  • Checking the properties of the action page after submitting, I see the Content-Type is correct
  • And the params of the form submission also look OK
  • But for some reason the entries received at Netlify are all empty

image

Any ideas? Thanks!!

Hi @contrafoque, welcome to the community!

I did check our system and it looks like the form definition for your form does not contain any fields. Are you using Javascript to render your form? Or do you have multiple forms that have the same form name?

The form is pure HTML, no JavaScript is run in the page apart from Google Analytics. There are no other pages with forms with contact-page name. Feel free to test https://contrafoque.com/contacto_test/

As I showed on the screenshot, the variables are sent in the form submission so I’m not sure what else may I be doing wrong :sweat:

One thing I should mention is that previously I had several pages with the same form name contact but I removed them and I renamed the form later to contact-page.

Hey @contrafoque,
All looks reasonable from here! Could you please update the form name from name="contact-page" to name="contact-page2" and confirm that you see the form with the new name in your forms dashboard? That’ll help us know that you’re in fact submitting to the form you expect and not an old one with the same name

Hi @jen

I’ve just set up a renamed form contact-page-testing, submitted an entry apparently with everything OK: Content-Type, form-name, etc.

and the result is still a blank submission :sweat:

Again, feel free to check it at https://contrafoque.com/contacto_test/

Thanks for your assistance!!

Hey @contrafoque,
I took a look at your contact form at https://contrafoque.com/contacto_test/ - that one is missing data-netlify="true" and netlify-honeypot="alternate-name" inside the opening <form> tag. Once I added those, I was able to get submissions to a duplicate of your form… that would be great news, except that you had both of those things in the first form you shared with us. So this doesn’t seem to be a problem with the HTML that you’re sharing with us here.

I would guess that your form attributes or " or ' characters are getting stripped/changed during the site build process. When Netlify processes your deploy, we look for any forms in your files, and then set up the fields that we expect submissions to. This is not happening with your forms- the HTML fields section is blank, so we never properly set up your form.

Can you say what static site generator you’re using? We have seen others run into issues where their static site generator strips or changes characters during build:

and when I view your page’s raw source (by entering view-source:https://contrafoque.com/contacto_test/ in the url bar in Firefox), I see that the fields are not formatted correctly :frowning:

1 Like

Thanks for your help @jen, you pointed me on the right direction when asking about the static generator.

I use Hugo, and some weeks ago I enabled the --minify option. I’ve just removed it and tested again the form without any other modification and it worked

I will let the site being built that way since it’s not a big deal for my setup, but I guess it’s something worth investigating from your side since Hugo is a popular generator.

Cheers! :heart:

Hey @contrafoque,
Awesome, very glad to hear that your form is up and running!

And yes, we are having conversations internally about how our forms work. If you’d like to share any feedback about your experience (including this debugging experience) to help us improve our forms, we’re running a poll over here and would love to hear your thoughts–> Tell us about your experience with Forms!