Cómo crear un formulario con código Javascript incrustado en Jotform

  • OCyT
    Fecha de consulta 15 de agosto de 2024, 19:55

    Buen dia, por favor es que tengo un formulario que envia un informe personalizado a traves de un codigo javascript, que es convertido a pdf, pero no se en donde encontrar dicho codigo. Requiero hacerle modificaciones. Nota: no cree dicho formulario. Gracias

  • Florence Jotform Support
    Fecha de respuesta 16 de agosto de 2024, 2:36

    Hi OCyT,

    Thanks for reaching out to Jotform Support. Our Spanish Support agents are busy helping other Jotform users right now, so I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in Spanish, let us know and we can have them do that. But, it might take a while until they're available again.

    Now, coming back to your question, unfortunately, applying custom Javascript codes to your form is not possible. It can only be done if you're embedding your form using its full source code where your own scripts will be injected directly before embedding it to your website. Let me show where to find the source code:

    1. In Form Builder, in the orange navigation bar at the top of the page, click on Publish.
    2. In the menu opens on the right side, select Embed.
    3. Click on Source Code at the bottom and then click on Download Source Code. That's it.

    Cómo crear un formulario con código Javascript incrustado en Jotform Image 1 Screenshot 20You might also want to check out these guides about Embedding a Form Into a Web Page and Which Form Embed Code Should I Use.

    If this isn't exactly what you’re looking for, can you explain a bit more so I can help you better?  Can you take a screenshot of what’s happening and send it to us? This guide will show you how to do that.

    Once we hear back from you, we'll be able to help you with this.

  • OCyT
    Fecha de respuesta 16 de agosto de 2024, 11:12
    good day.
    Maybe I didn't understand that your answer is to obtain the code embedded in a web page and that is not what I need.

    What I need is to look at where the source code of a logic associated with the form is associated to send a personalized report to each user who fills out the form.

    I do not send the associated source code because it is very extensive.
    If you can help me I would appreciate it very much.


  • Jovito Jotform Support
    Fecha de respuesta 16 de agosto de 2024, 14:45

    Hi OCyT,

    Do you mean sending a PDF file or a submission report of the user? In Jotform, we have a built-in feature of sending email and attached PDF to user who fill ups the form and don't need source code for this feature. You can configure your form to send an Autoresponder Email that contains the information of their submissions or attached a PDF file to every user who fills up the form. Let me show you how:

    1. IForm Builder, in the orange navigation bar at the top of the page, click on Settings.

    2. In the menu on the left side of the page, click on Emails.

    3. Now, click on Add Email and select Autoresponder Email. Go to Recipients to ensure that the Recipient Email is set to the email field of your form.

    4. Go to Advanced Tab, turn on Attach PDF, then choose the PDFs to attach.

    5. Click Save.

    Cómo crear un formulario con código Javascript incrustado en Jotform Image 1 Screenshot 20

    If that’s not exactly what you’re looking for, can you explain a bit more, so I can help you better?

    Once we hear back from you, we'll be able to move forward with a solution.


  • OCyT
    Fecha de respuesta 16 de agosto de 2024, 16:16
    Hello, look at that option, I already know how to use it. but what I want is how to personalize that email to be sent. I have a javascript file where custom logic is applied and from this javascrpt file create the pdf file. and what you want to send is the personalized report. what you mention is a pdf attachment


  • Jovito Jotform Support
    Fecha de respuesta 16 de agosto de 2024, 16:51

    Hi OCyT,

    Unfortunately, as what my colleagues said in the previous reply, it is not possible to add or upload a JavaScript file in Jotform. You can only download the full source code of the form, and then you can apply your custom logical conditions and add it to your website.

    As a workaround, if you want to attach a PDF file, that will depend on the user. You can create multiple Autoresponders Email and attached to them are every PDF file. I suggest creating a more general PDF file that can be categorized depending on the user. You can refer to my previous reply on how to create an Autoresponder Email, and we can use conditions to send the Autoresponders Email depending on the condition you impose, in my case I use the options in the dropdown field. Let me show you how:

    1. Open your form in Form Builder, and in the orange navigation bar at the top of the page, click on Settings.
    2. In the menu on the left side of the page, click on Conditions.
    3. Click on Add a New Condition and select a Condition Type.
    4. Select Change Email Recipient, and set up the fields depending on your logic. 

    Cómo crear un formulario con código Javascript incrustado en Jotform Image 1 Screenshot 20

    Note, do not forget to attach the PDF file to every Autoresponder email.

    Give it a try and let us know how it goes.