What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Thank you page with a link that downloads my PDF file

    Asked by nexigensales on June 01, 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=javascript: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!

  • Profile Image
    JotForm Support

    Answered by EltonCris on June 01, 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.

  • Profile Image

    Answered by nexigensales on June 01, 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.

  • Profile Image
    JotForm Support

    Answered by EltonCris on June 01, 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.

    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.

  • Profile Image
    JotForm Support

    Answered by EltonCris on June 01, 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

  • Profile Image

    Answered by Daniel Lewis  on July 25, 2016 at 03: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.

  • Profile Image
    JotForm Support

    Answered by Kiran on July 25, 2016 at 05: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!