Step 1 Create a form in breakdance

Give it a

  • Form Name MyLeadMagnet
  • unique Form HTML ID MyUniqueFormID
  • unique Submit HTML ID MyUniqueSubmitID

Lead magnet form setup interface options
form set up
Email submission form with submit button.

Step 1, Extra Steps

I like to add some hidden fields and pass them through to mailerlite, or in the data I send to spreadsheets or crm’s via my webhook for example, you might like to include the URL of the page you have added the form to (if you use it on multiple pages) or include the name of the lead magnet so in mailerlite you know what the person was interested in (you would need to have a field, or custom field in mailerlite to send it to to though)

Interface showing URL and LM_NAME hidden fields setup.
form extra steps – instant lead magnet download

Select your form actions

But Vanessa? Why haven’t you selected JS? Aren’t we using that? – Yes we are, but not like that.

Select the options you want to use, you dont actually need to select any of them for this JS instant download to work, but the extra cool things you will need them as explained further below.

Add a code block near the form.

Add this snippet

Update the following

Form Name: MyLeadMagnet
Success Message:✅ Thanks! Your Pre Quote Question List download is starting…
The Actual File Path /wp-content/uploads/2025/08/myactualfilename.pdf
What you want the download to down load as The-File-Name-I-Want-Ppl-To-Have.pdf

<script>
document.addEventListener("DOMContentLoaded", function () {
  const form = document.getElementById("MyLeadMagnet-InstantDownload");

  form.addEventListener("submit", function (event) {
    event.preventDefault();

    // Simulate Breakdance success handler
    setTimeout(() => {
      // Hide form
      form.style.display = "none";
      // Show success message
      let successMsg = document.createElement("div");
      successMsg.id = "formSuccess";
      successMsg.textContent = "✅ Thanks! Your download is starting...";
      form.parentNode.appendChild(successMsg);
      // Trigger download
      const link = document.createElement("a");
      link.href = "/wp-content/uploads/2025/08/myactualfilename.pdf";
      link.download = "The-File-Name-I-Want-Ppl-To-Have.pdf";
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
    }, 800);
  });
});
</script>