Form previewSubmissions stay in this preview

Use this template

This example uses the Pro limits. On Agency, copy the Drag & drop example from your form’s Setup to include your plan’s limits and your CAPTCHA configuration.

Copy the code

Replace the example origin and access key with the values from your form’s setup screen. Send a test message from each site you publish and check the submission in your inbox.

HTML
<style>
  [data-forms4web-upload-zone] {
    min-width: 0;
    margin: 1rem 0;
    padding: 0.85rem;
    border: 1px dashed #7857a6;
    border-radius: 0.65rem;
    background: #f7effa;
    color: #281d37;
  }
  [data-forms4web-dragging] { background: #eadbf3; }
  [data-forms4web-upload-zone] input { max-width: 100%; }
  [data-forms4web-upload-zone] li { overflow-wrap: anywhere; }
  [data-forms4web-upload-zone] li button { margin-inline-start: 0.5rem; }
</style>
<script src="https://api.bitebrake.com/client/upload.js" defer></script>
<form id="contact" action="https://api.bitebrake.com/api/submit" method="post" enctype="multipart/form-data">
  <input type="hidden" name="access_key" value="YOUR_FORM_ACCESS_KEY">
  <label>Name <input name="name" autocomplete="name" required></label>
  <label>Email <input name="email" type="email" autocomplete="email" required></label>
  <label>Message <textarea name="message" required></textarea></label>
  <fieldset data-forms4web-upload-zone>
    <legend>Attachments</legend>
    <label>Choose files
      <input type="file" name="attachment" multiple accept=".pdf,.png,.jpg,.jpeg"
        data-forms4web-upload data-forms4web-max-files="2" data-forms4web-max-file-bytes="5000000"
        aria-describedby="contact-attachment-hint">
    </label>
    <p id="contact-attachment-hint">Up to 2 PDF, PNG, or JPEG files, 5 MB each.</p>
  </fieldset>
  <input type="text" name="botcheck" hidden tabindex="-1" autocomplete="off">
  <button type="submit">Send message</button>
</form>
<p id="contact-result" role="status"></p>
<script>
(() => {
  const form = document.querySelector('#contact');
  const status = document.querySelector('#contact-result');
  const button = form.querySelector('button[type="submit"]');
  const dropZone = form.querySelector('[data-forms4web-upload-zone]');

  form.addEventListener('submit', async (event) => {
    event.preventDefault();
    if (button.disabled) return;
    button.disabled = true;
    status.textContent = 'Sending…';
    try {
      const data = new FormData(form);
      dropZone.disabled = true;
      const response = await fetch(form.action, {
        method: 'POST',
        headers: { Accept: 'application/json' },
        body: data,
      });
      const result = await response.json();
      status.textContent = result.error || result.message;
      if (response.ok && result.success) form.reset();
    } catch {
      status.textContent = 'Could not send. Please try again.';
    } finally {
      button.disabled = false;
      dropZone.disabled = false;
    }
  });
})();
</script>
Connect this templateBrowse form templates