Capturing form data using Netlify

82 Views Asked by At

My Netlify is not capturing data from my web form. It is recording a submission, but all the fields are empty. It is only spitting back the field titles and not the field content. I have a very basic sign up form. Nothing fancy at all. As per instruction on their site, I added a form name and the data-netlify="true" attribute. I tried submitting the form. No luck. Is there anything else I need to do for this to work? Here is the html for my form.

<form name="Fleet Signup" data-netlify="true" class="simple_form" method="post">
   <input name="_csrf_token" type="hidden">
   <div class="form-inputs mt-4 font-thin text-gray-700">
      <div class="flex justify-between">
         <div class="input mt-2 mr-2 w-full">
            <div class="label hidden">
               <label class="control-label" for="user_first_name">First name</label>
            </div>
            <div class="field">
               <input class="form-control border border-gray-300 p-3 rounded w-full font-medium" id="user_first_name" name="user[first_name]" placeholder="First Name" type="text">
            </div>
         </div>
         <div class="input mt-2 w-full">
            <div class="label hidden">
               <label class="control-label" for="user_last_name">Last name</label>
            </div>
            <div class="field">
               <input class="form-control border border-gray-300 p-3 rounded w-full font-medium" id="user_last_name" name="user[last_name]" placeholder="Last Name" type="text">
            </div>
         </div>
      </div>
      <div class="input mt-2 w-full">
         <div class="label hidden">
            <label class="control-label" for="user_email">Email</label>
         </div>
         <div class="field">
            <input class="form-control border border-gray-300 p-3 rounded w-full font-medium" id="user_email" name="user[email]" placeholder="Email Address" type="email">
         </div>
      </div>
      <div class="input mt-2 w-full">
         <div class="label hidden">
            <label class="control-label" for="user_password">Password</label>
         </div>
         <div class="field">
            <input class="form-control border border-gray-300 p-3 rounded w-full font-medium" id="user_password" name="user[password]" placeholder="Password" type="password">
         </div>
      </div>
      <div class="input mt-2 w-full">
         <div class="label hidden">
            <label class="control-label" for="user_phone_number">Company</label>
         </div>
         <div class="field">
            <input class="form-control border border-gray-300 p-3 rounded w-full font-medium" id="user_phone_number" name="user[phone_number]" placeholder="Phone" type="phone">
         </div>
      </div>
      <div class="input mt-2 w-full">
         <div class="label hidden">
            <label class="control-label" for="user_terms_of_service">Terms of service</label>
         </div>
         <div class="field">
            <input name="user[terms_of_service]" type="hidden" value="false"><input class="form-control" id="user_terms_of_service" name="user[terms_of_service]" type="checkbox" value="true">
            <span class="p-2 font-medium text-xs">
            I agree to Fleet's <a class="underline" target="_blank" href="#../legal.html#terms-of-service">Terms of service</a> and consent to it's <a class="underline" target="_blank" href="#../legal.html#developer-privacy-policy">Privacy policy</a>.
            </span>
         </div>
      </div>
   </div>
   <div class="form-actions mt-4">
      <button class="px-4 py-3 w-full font-bold text-white bg-black rounded" type="submit">Next</button>
   </div>
</form>
0

There are 0 best solutions below