Search code examples
htmlcssemailform-submit

formsubmit messages recieved are blank even with name=""


Here is my code. As you can see, I have the name="" on all of the fields I want to be sent to me, but when I fill out the form and check my email it is blank.

            <div class="col-lg-6">
              <div class="contact-form">
                <form action="https://formsubmit.co/[email protected]" method="POST" enctype="text/plain">
                  <input type="hidden" name="_next" value="https://mywebsite..app/thanks.html">
                  <div class="form-group mb-4 pb-2">
                    <label for="exampleFormControlInput1" class="form-label">Full Name</label>
                    <input type="text" class="form-control shadow-none" name="name" id="contact_name">
                  </div>
                  <div class="form-group mb-4 pb-2">
                    <label for="exampleFormControlInput1" class="form-label">Email address</label>
                    <input type="email" class="form-control shadow-none" name="email" id="contact_email">
                  </div>
                  <div class="form-group mb-4 pb-2">
                    <label for="exampleFormControlTextarea1" class="form-label">Write Message</label>
                    <textarea name="message" class="form-control shadow-none" id="exampleFormControlTextarea1" placeholder="message" rows="3"></textarea>
                  </div>
                  <button class="btn btn-primary w-100" type="submit">Send Message</button>
                </form>
              </div>
            </div>

I've tried using the disposable email service as well and it still doesn't work with my code.

Could anyone help me out with that?


Solution

  • The issue with the structure lies in the enctype characteristic of the structure component. The enctype quality indicates how the structure information ought to be encoded prior to submitting it to the server. For this situation, the structure is utilizing "text/plain" encoding, which isn't reasonable for FormSubmit.

    FormSubmit requires the structure information to be encoded in by the same token "application/x-www-structure urlencoded" or "multipart/structure information" design. These configurations permit information to be sent with key-esteem matches, where the keys relate to the names of the structure fields.

    To fix the issue, the software engineer ought to eliminate the enctype property from the structure tag. Thusly, the structure will default to "application/x-www-structure urlencoded" encoding, which is viable with FormSubmit. This change will empower the structure information to be sent accurately with the field names and relating values.

    The amended code ought to seem to be this:

    <div class="col-lg-6">
      <div class="contact-form">
        <form action="https://formsubmit.co/[email protected]" method="POST">
          <input type="hidden" name="_next" value="https://mywebsite..app/thanks.html">
          <div class="form-group mb-4 pb-2">
            <label for="exampleFormControlInput1" class="form-label">Full Name</label>
            <input type="text" class="form-control shadow-none" name="name" id="contact_name">
          </div>
          <div class="form-group mb-4 pb-2">
            <label for="exampleFormControlInput1" class="form-label">Email address</label>
            <input type="email" class="form-control shadow-none" name="email" id="contact_email">
          </div>
          <div class="form-group mb-4 pb-2">
            <label for="exampleFormControlTextarea1" class="form-label">Write Message</label>
            <textarea name="message" class="form-control shadow-none" id="exampleFormControlTextarea1" placeholder="message" rows="3"></textarea>
          </div>
          <button class="btn btn-primary w-100" type="submit">Send Message</button>
        </form>
      </div>
    </div>
    

    Subsequent to rolling out this improvement, the structure information will be sent in the right configuration, and when the client presents the structure, the email got ought to contain the finished up data true to form.