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

    How to add custom javascript to a form?

    Asked by lukerohler on August 09, 2016 at 05:04 PM

    I would like to add custom javascript to a form so I can calculate and display my customers weekly price before they submit their form (its for a service business). I would also like to be able to include this in auto reply emails, and dump it into my Google Spreadsheets integration along with the rest of their form data, however, it cannot be editable. Simply a formula as a result of their answers.

     

    How might I be able to do this?

     

    Thanks,

    Luke

    Page URL:
    auroralawns.com

    custom javascript
  • Profile Image
    JotForm Support

    Answered by Welvin on August 09, 2016 at 06:57 PM

    Unfortunately, it's not possible in the form builder. Why not use our calculation widget to do that? 

    https://www.jotform.com/help/259-How-to-perform-calculation-in-the-form

    I can see that you are trying to pipe the result in the text field, that is also now possible in Jotform.

    Just get the field name and paste it in the text field: 

    https://www.jotform.com/help/146-How-to-find-Field-IDs-Names 

    Here's a test form with piping added in the text field: https://form.jotform.com/62216213066951. Fill the name and email to see the result.

     

    If you prefer to do it by Javascript, you can get the source codes: https://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form. Modify the source codes to suit your needs before embedding it to your website.