Thank you page with a link that downloads my PDF file

  • nexigensales
    Asked on June 1, 2016 at 10:42 AM

    I have a form in a LightBox. I want it set up so that when someone fills out the form and clicks submit, it will take them to a thank you page, but that thank you page also downloads a PDF. I don't want it as a download link though. I have tried using

     

    <!-- <meta http-equiv="refresh" content="3; URL=javascriptDISABLED:window.open('http://dev.nexigen.com/wp-content/uploads/2016/05/NexigenInfoDoc.pdf','_blank');"> -->

    so that it opens it in a new tab, but every time I save the html, it strips it. Is there a workaround to make this happen? I was thinking about using an onLoad but I believe it would also strip that.

    Thanks!

  • Elton Support Team Lead
    Replied on June 1, 2016 at 11:50 AM

    Yes, any inline javascript codes will be stripped off for security reasons. You can't also embed any scripts on the Text HTML field. They will be removed. These are just common methods to execute XSS or any malicious codes into the form builder which expose our system into risk.

    The only workaround is to apply your custom codes into your form source code. http://www.jotform.com/help/104-How-to-Download-a-Source-Code-of-your-Form

    However, if you only want to display a PDF in your form, you can use these widgets.

    http://widgets.jotform.com/widget/pdf_embedder

    http://widgets.jotform.com/widget/iframe_embed

    If you need further assistance, let us know.

  • nexigensales
    Replied on June 1, 2016 at 12:17 PM

    The source code still doesn't let me change anything on the thank you page, it is for the form itself.

  • Elton Support Team Lead
    Replied on June 1, 2016 at 12:25 PM

    You have to download your form source code and edit/insert any codes on the HTML file. The downloaded file contains the HTML file of your form, the css and js files. You have to edit the HTML file if you want to make any changes on your form.

    Thank you page with a link that downloads my PDF file Image 1 Screenshot 20

    You can't make any changes on the source code box shown in the publish wizard. It is only meant for copying, not editing.

    If you mean on the thank you page, unfortunately, it works the same way on the form builder. You can't use hyperlink codes with javascript or any scripts on the thank you page editor or within the source code box. It will be stripped off.

  • Elton Support Team Lead
    Replied on June 1, 2016 at 12:28 PM

    I just realized that you are referring to your form's thank you page. I would suggest

    Since our form thank you page does not allow your code (because as I've said, it contains javascript code) I would suggest to create a custom thank you page instead and embed your hyperlink code there. Then set your custom thank you page as your form's thank you URL. Here's how: http://www.jotform.com/help/38-How-to-Redirect-to-a-Page-After-Form-Submission

  • Daniel Lewis
    Replied on July 25, 2016 at 3:11 PM

    I'm also trying to automatically download a pdf when the user's redirected to a custom thank you page after filling out a JotForm. Doing this right now with a document.ready function that sets a timeout that calls window.open. The issue though is that Chrome blocks the download as a popup. Any idea how to do this without the download being blocked?


    Thanks.

  • Kiran Support Team Lead
    Replied on July 25, 2016 at 5:15 PM

    @Daniel,

    Your question is moved to a separate thread and shall be addressed there shortly.

    https://www.jotform.com/answers/890236

    Thank you!