【问题标题】:Linking custom HTML Form to Google Form (How to handle Date input?)将自定义 HTML 表单链接到 Google 表单(如何处理日期输入?)
【发布时间】:2020-07-21 10:02:40
【问题描述】:

我正在尝试将自定义 HTMl 表单链接到现有的 Google 表单。我已将 action 和 name 属性与表单相匹配(下面的 html sn-p 中的占位符以保护隐私)。

我的自定义表单

<form action="https://docs.google.com/forms/PLACEHOLDERurl" method="post">
  <div class="form-group">
    <label class="mb-0" for="name">First & Last Name</label>
    <input class="form-control" name="entry.PLACEHOLDER" type="text" id="name" placeholder="Enter name" required>
  </div>
  <div class="form-group">
    <label for="date" class="mb-0">Pick Up Date</label>
    <input id="pick-up-date" type="date" class="form-control">
  </div>
  <button id="testFormSubmit" type="submit" value="submit" class="btn btn-main-color">Submit</button>
</form>

但是,谷歌表单上的日期输入有 3 个“名称”属性。

来自 Google 表单的主要日期输入

<input type="date" class="quantumWizTextinputPaperinputInput exportInput" jsname="YPqjbf" autocomplete="off" tabindex="0" value="" data-initial-value="2020-04-14" badinput="false" dir="ltr">

来自 Google 表单的每个名称值(年、日、月)的 3 个隐藏输入

<input type="hidden" name="entry.2099319546_year" jsname="L9xHkb_year" value="2020">
<input type="hidden" name="entry.2099319546_month" jsname="L9xHkb_month" value="4">
<input type="hidden" name="entry.2099319546_day" jsname="L9xHkb_day" value="14">

有人可以告诉我如何更改我的自定义日期表单输入以匹配此格式吗?

【问题讨论】:

    标签: html forms google-forms


    【解决方案1】:

    我正在处理同样的问题,但结果证明解决方案非常简单。 您只需删除下划线值('_year')并仅使用条目 id。

    entry.2099319546
    

    不管他们有三个不同的输入,而你只有一个,谷歌无论如何都会识别它。

    Check this tutorial from Codepen

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-26
      • 2021-08-11
      • 1970-01-01
      • 2013-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多