Missing field Values

Some of the fields in the Contact Us form at https://youthful-yonath-d0edfa.netlify.app/contact/contact_us/ are being accepted, but then stored as empty when the form is submitted.

The site is generated from Drupal using the Tome and Tome Netlify modules.

I’ve gone through the suggestions in [Support Guide] Form problems, form debugging, 404 when submitting and don’t see an obvious issue other than I did notice the field names generated by Drupal look like array references, which makes sense for Drupal, e.g. the Best Contact Number field’s name=“field_best_contact_number[0][value]”.

Is that causing some issue on the Netlify side???

We’ve decided to disable the form until I can sort this out so the above link won’t show the form. The HTML from the form before being disabled was:

  <div class="content">
  <form class='contact-message-contact-us-form contact-message-form contact-form' data-user-info-from-browser data-drupal-selector='contact-message-contact-us-form' action='/contact/thank-you' method='post' id='contact-message-contact-us-form' accept-charset='UTF-8'><input type='hidden' name='form-name' value='contact-message-contact-us-form' />
 <div class="js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-name form-item-name">
  <label for="edit-name" class="js-form-required form-required">Your name</label>
    <input data-drupal-selector="edit-name" type="text" id="edit-name" name="name" value="" size="60" maxlength="255" class="form-text required" required="required" aria-required="true" />

    </div>
 <input autocomplete="off" data-drupal-selector="form-vzicjecueqcndo7ehsjqcvx-ws3o7ya8lsdcltky3oe" type="hidden" name="form_build_id" value="form-vZicJECuEQcnDo7EHsJQcvX-WS3O7ya8LsdcltKY3oE" />
 <input data-drupal-selector="edit-contact-message-contact-us-form" type="hidden" name="form_id" value="contact_message_contact_us_form" />
 <input name="tome-netlify-honeypot" style="display:none !important" tabindex="-1" autocomplete="off" /><div class="field--type-string field--name-field-best-contact-number field--widget-string-textfield js-form-wrapper form-wrapper" data-drupal-selector="edit-field-best-contact-number-wrapper" id="edit-field-best-contact-number-wrapper">      <div class="js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-field-best-contact-number-0-value form-item-field-best-contact-number-0-value">
  <label for="edit-field-best-contact-number-0-value">Best Contact Number</label>
    <input class="js-text-full text-full form-text" data-drupal-selector="edit-field-best-contact-number-0-value" type="text" id="edit-field-best-contact-number-0-value" name="field_best_contact_number[0][value]" value="" size="60" maxlength="20" placeholder="" />

    </div>

 </div>
 <div class="field--type-language field--name-langcode field--widget-language-select js-form-wrapper form-wrapper" data-drupal-selector="edit-langcode-wrapper" id="edit-langcode-wrapper">      
</div>
  <div class="js-form-item form-item js-form-type-email form-type-email js-form-item-mail form-item-mail">

     <label for="edit-mail" class="js-form-required form-required">Your email address</label>
    <input data-drupal-selector="edit-mail" type="email" id="edit-mail" name="mail" value="" size="60" maxlength="254" class="form-email required" required="required" aria-required="true" />

    </div>
   <div class="field--type-string field--name-subject field--widget-string-textfield js-form-wrapper form-wrapper" data-drupal-selector="edit-subject-wrapper" id="edit-subject-wrapper">      <div class="js-form-item form-item js-form-type-textfield form-type-textfield js-form-item-subject-0-value form-item-subject-0-value">
  <label for="edit-subject-0-value" class="js-form-required form-required">Subject</label>
    <input class="js-text-full text-full form-text required" data-drupal-selector="edit-subject-0-value" type="text" id="edit-subject-0-value" name="subject[0][value]" value="" size="60" maxlength="100" placeholder="" required="required" aria-required="true" />

    </div>

  </div>
   <div class="field--type-string-long field--name-message field--widget-string-textarea js-form-wrapper form-wrapper" data-drupal-selector="edit-message-wrapper" id="edit-message-wrapper">      <div class="js-form-item form-item js-form-type-textarea form-type-textarea js-form-item-message-0-value form-item-message-0-value">
  <label for="edit-message-0-value" class="js-form-required form-required">Message</label>
    <div class="form-textarea-wrapper">
  <textarea class="js-text-full text-full form-textarea required resize-vertical" data-drupal-selector="edit-message-0-value" id="edit-message-0-value" name="message[0][value]" rows="12" cols="60" placeholder="" required="required" aria-required="true"></textarea>
</div>

    </div>

 </div>
  <div><script src='https://www.google.com/recaptcha/api.js'></script>
 <div class='g-recaptcha' data-sitekey='6LdAvUIUAAAAAHjrjmjtNTcXyKm0WKwefLp-dQv9'></div>
  <noscript>
  <div>
  <div style="width: 302px; height: 422px; position: relative;">
 <div style="width: 302px; height: 422px; position: absolute;">
   <iframe src="https://www.google.com/recaptcha/api/fallback?k=6LdAvUIUAAAAAHjrjmjtNTcXyKm0WKwefLp-dQv9" frameborder="0" scrolling="no"
style="width: 302px; height:422px; border-style: none;">
   </iframe>
  </div>
  </div>
  <div style="width: 300px; height: 60px; border-style: none; bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px; background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;">
    <textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response"
  style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none;" >
     </textarea>
   </div>
  </div>
 </noscript>
 </div><div data-drupal-selector="edit-actions" class="form-actions js-form-wrapper form-wrapper" id="edit-actions"><input data-drupal-selector="edit-submit" type="submit" id="edit-submit" name="op" value="Send message" class="button button--primary js-form-submit form-submit" />
</div>

</form>

</div>

Hi @greggmarshall, welcome to the Community!

Could you tell us which one of your fields are being stored empty? I suspect that array references like you mentioned can definitely affect where our form handling will find the field values. I would recommend that not having those unless it’s a select or radio field. Let me know if that helps.

Best Contact Number, Subject and Message are not being stored, which happens to correspond to the array references. Let me look at a patch for the module on the Drupal side to suppress them.

1 Like