Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular

    REMINDER

    Please be respectful of all AppDragers! Keep it really civil so that we can make the AppDrag community of builders as embracing, positive and inspiring as possible.

    Downloading a document after to leave name and the mail

    Cloud CMS (Pagebuilder, Blog, Shop, Newsletters, Code Editor)
    2
    2
    153
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Patrick Maarek
      Patrick Maarek last edited by Wassim

      Hello to the support team, Wassim, Joseph Thank you for answering me quickly I would like to propose to the Internet users a button to download a training program; but when clicked on the download button i would like it to arrive on the page of the form where it entered its first name, name, email and mobile. And then only when he clicks the button validate the form I would like to trigger the download of the program. My question is how to get the name of the program he wants (there are 6) button he clicked on the homepage

      Website https://prod.appdrag.com/Builder/pagebuilder.html?appId=up-to-care-82bf3a#PAGE_index

      Up to Care

      1 Reply Last reply Reply Quote 0
      • Wassim
        Wassim last edited by

        Hello,
        You would need a little bit of javascript to do it.

        • First of all on all your different training program download button you would do a link to your form with an additional URL parameter "training=mytraining1"
        • Then on your form configuration go to in After Summit >insert HTML after submission (or in a CloudBackend function it would be after function call > execute custom javascript code)
        • Your javascript would look like something like this
        var targetFile = '';
        var training = getParamFromUrl('training'); // getParamFromUrl is available on all AppDrag Websites
        if (training == 'mytraining1') {
          targetFile = 'https://linktomypdffile1.pdf';
        }
        if (training == 'mytraining2') {
          targetFile = 'https://linktomypdffile2.pdf';
        }
        if (targetFile != '') {
          window.open(targetFile, '_blank'); // this code open it in a new tab if you want to be redirected entirely to the file use window.location.href = targetFile;
        }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post