Drupal 7 Webform - 提交按钮和文件上传按钮打破表单

时间:2016-02-02 10:37:26

标签: forms drupal submit drupal-webform

我使用Drupal 7和Webform表单。今天我在文件中添加了文件上传。无论何时上传文件,页面都会重新加载并成功上传文件。所以我觉得这很烦人,我用css禁用了上传按钮(display:none;)。我注意到,当我按下表格的正常提交按钮时,文件会上传。

问题是提交按钮(提交表单和上传文件)都是上传文件,没有别的。所以我删除了文件上传,再次尝试了表单并且工作正常。

昨天我的文件上传时也有同样的表格,也有效。今天它破碎了,我不明白为什么。我改变了什么。我只是打开浏览器并测试页面。

以下是我的表格代码:

<form class="webform-client-form" enctype="multipart/form-data" action="/ppi/de/fcfay-16-free-coffee-year-ppi-media" method="post" id="webform-client-form-800" accept-charset="UTF-8">
  <div>
    <div class="form-item webform-component webform-component-textfield" id="webform-component-name">
      <label class="element-invisible" for="edit-submitted-name">Name <span class="form-required" title="Diese Angabe wird benötigt.">*</span>
      </label>
      <input type="text" id="edit-submitted-name" name="submitted[name]" value="Test" size="60" maxlength="128" class="form-text required">
    </div>
    <div class="form-item webform-component webform-component-email" id="webform-component-e-mail">
      <label class="element-invisible" for="edit-submitted-e-mail">E-Mail</label>
      <input class="email form-text form-email" type="email" id="edit-submitted-e-mail" name="submitted[e_mail]" value="test@test.com" size="60">
    </div>
    <div class="form-item webform-component webform-component-textfield" id="webform-component-telefon">
      <label class="element-invisible" for="edit-submitted-telefon">Telefon</label>
      <input type="text" id="edit-submitted-telefon" name="submitted[telefon]" value="023847272" size="60" maxlength="128" class="form-text">
    </div>
    <div class="form-item webform-component webform-component-textfield" id="webform-component-video-link">
      <label class="element-invisible" for="edit-submitted-video-link">Video Link</label>
      <input type="text" id="edit-submitted-video-link" name="submitted[video_link]" value="http://www.youtube.com" size="60" maxlength="128" class="form-text">
    </div>
    <div id="edit-submitted-datei-hochladen-ajax-wrapper">
      <div class="form-item webform-component webform-component-managed_file webform-container-inline" id="webform-component-datei-hochladen">
        <label for="edit-submitted-datei-hochladen-upload">Upload</label>
        <div id="edit-submitted-datei-hochladen-upload" class="form-managed-file"><span class="file"><img class="file-icon" alt="" title="image/png" src="/ppi/modules/file/icons/image-x-generic.png"> <a href="https://censoredtheurl.de/files/webform/test/lp_1.png" type="image/png; length=428938">lp.png</a></span> 
          <input type="submit"
          id="edit-submitted-datei-hochladen-remove-button" name="submitted_datei_hochladen_remove_button" value="Entfernen" class="form-submit">
          <input type="hidden" name="submitted[datei_hochladen][fid]" value="2140">
        </div>
        <div class="description">(Max. 5MB - gif, jpg, png, eps, tif, psd, txt, rtf, pdf, doc, docx, ppt, pptx, xls, xlsx, xml, zip, rar)</div>
      </div>
    </div>
    <div class="form-item webform-component webform-component-textarea" id="webform-component-nachricht">
      <label for="edit-submitted-nachricht">Nachricht</label>
      <div class="form-textarea-wrapper resizable">
        <textarea id="edit-submitted-nachricht" name="submitted[nachricht]" cols="60" rows="5" class="form-textarea">Test</textarea>
      </div>
    </div>
    <input type="hidden" name="details[sid]">
    <input type="hidden" name="details[page_num]" value="1">
    <input type="hidden" name="details[page_count]" value="1">
    <input type="hidden" name="details[finished]" value="0">
    <input type="hidden" name="form_build_id" value="form-YNH6iMPMrKyMKzlJOvV0dPotbFQ3iM-xkGYCGeRw3Ho">
    <input type="hidden" name="form_id" value="webform_client_form_800">
    <input type="hidden" name="honeypot_time" value="1454407697|T7pTBVfnoioY6JQxJ5wOclnk_F9kcCdpclFi3C4m0fc">
    <div class="url-textfield">
      <input type="submit" id="edit-submit" name="op" value="Absenden" class="form-submit">
    </div>
  </div>
</form>

0 个答案:

没有答案