How to add custom javascript to a form?

  • lukerohler
    Asked on August 9, 2016 at 5: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

  • Welvin Support Team Lead
    Replied on August 9, 2016 at 6: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.