Home
Support Forums

Submitted forms are blank

Hello,

I am using the netlify-forms on my deployment and so far it worked great. But since a few days all entries appear blank on the netlify froms site. Even the ones from a few weeks ago.

Netlify-ID: eloquent-tereshkova-fc3b18

Screenshot 2021-07-07 at 12.08.20|690x376

Thanks for looking into this!
Jan

Hey @jan_q27,

Is it possible it’s some browser or network side problem? Maybe you’ve some extensions or something that might be blocking the rendering. Could you try a different browser/device/network?

If it’s the same, could you post the logs from browser console?

I tried different browsers (Safari, Chrome) both with and without extension.

But it’t not only the browser, the notification email was also empty.

Screenshot 2021-07-07 at 13.25.43

Hi @jan_q27,

Do you have the email notification of the previous messages. From our logs, we can see that the submission on July 3 was indeed empty but the ones before were not. So, you could ignore the submission on Jul 3.

If you wish, you could try triggering another form submission and see how it goes.

I just tried it and this was also empty. So I took a look into the log and found a warning.

8:18:49 AM: WARNING: There are no fields detected for form contact. Check that any existing form fields have name attributes.

As it was working before, were there any changes regarding the form detection?

This is a screenshot from the last knowing submission.
Screenshot 2021-06-29 at 21.45.28

Hi @jan_q27,

No, there was no change in form detection and that message matches the submission that we can see on our end. Could you share the repo so we can check this?

The repo it self is on a private repo → https://github.com/pukao/website-yct
So I don’t know if you can access it.

However this is the related code:

      <form name="contact" method="POST" netlify-honeypot="robo" data-netlify="true" action="contact/submit/">
        <div class="col-md-6 col-sm-12">
          <div class="block">
            <div class="form-group">
              <input name="user_name" type="text" class="form-control" placeholder="Name" required>
            </div>
            <div class="form-group">
              <input name="user_email" type="text" class="form-control" placeholder="Email Adresse" required>
            </div>
            <div class="form-group">
              <input name="user_subject" type="text" class="form-control" placeholder="Titel">
            </div>
            <div class="hidden">
              <input name="robo" type="text" class="form-control" placeholder="Don't fill this out">
            </div>
          </div>
        </div>
        <div class="col-md-6 col-sm-12">
          <div class="block">
            <div class="form-group-2">
              <textarea name="user_message" class="form-control" rows="4" placeholder="Nachricht" required></textarea>
            </div>
            <button class="btn btn-default" type="submit">{{ i18n "submit" }}</button>
          </div>
        </div>
      </form>

I was able to identify my change which caused the issue.

I removed the --minify build option for hugo in the build command and now the input fields are getting detected.

Thanks :slight_smile:

That’s weird. Minify option would simply minify the HTML and it’s recommended you leave the option on. I have my own Hugo websites with minify that works fine with forms. So, that’s a rather strange solution.

Odd, maybe you can spot the difference in the deploy information.

Working: Netlify App
Not Working: Netlify App

Both are on the master branch and the only difference is the removal of the --minify option.

diff --git a/netlify.toml b/netlify.toml
index dcc7bf1..ac786c6 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -1,13 +1,13 @@
 [build]
   publish = "yct_content/public"
-  command = "cd yct_content && hugo --gc --minify --themesDir ../.."
+  command = "cd yct_content && hugo --gc --themesDir ../.."
   
 [build.environment]
   HUGO_VERSION = "0.82.1"
   HUGO_THEME = "repo"
 
 [context.deploy-preview]
-  command = "cd yct_content && hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL --themesDir ../.."
+  command = "cd yct_content && hugo --gc --buildFuture -b $DEPLOY_PRIME_URL --themesDir ../.."
 
 [context.branch-deploy]
-  command = "cd yct_content && hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL --themesDir ../.."
+  command = "cd yct_content && hugo --gc --buildFuture -b $DEPLOY_PRIME_URL --themesDir ../.."

I’m glad you found the solution as I’d not have guessed that. I compared the minified and the non-minified version and the only difference is the absence of " " around attribute values that have no spaces in them. So, I have no explanation as to why it should not work, especially since it was working before when you had minify option on. But what matters more is that it’s solved.

My apologies, I added the minify option while adding support for the PR-deploy configuration. I think I saw it in a suggested build configuration example somewhere in the netlify documentation.
From what I can see, it never worked for me with that option enabled.

Cheers,
Jan