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

    Is it possible to add javascript to the HTML form to create dynamic features?

    Asked by Brandon on April 03, 2012 at 09:20 PM

    Let's say, for example, I want to create a form which a user can use to create a background for a webpage of any color or decor. Is it possible to integrate javascript into the form, and if so how could I do that, so the script will create a background according to whatever request is submitted in the form?

    javascript dynamic html form create
  • Profile Image

    Answered by jeanettebmz on April 03, 2012 at 09:27 PM

    @Brandon

    I have made a research into the forum threads , and found out that javascripts are not allowed to be embedded into Free Text HTML fields.

    This rule is put in place to prevent problems arising from conflicts with the embedded scripts and the form's own scripts.

    Jeanette

     

  • Profile Image
    JotForm Support

    Answered by abajan on April 03, 2012 at 10:26 PM

    If a copy of the form's source is acquired from the Embed Form Wizard (Setup & Embed tab > Embed Form) JavaScript can be added to the page within which the said source has been pasted to achieve various effects, as illustrated on this page. The block of JavaScript just before the closing body tag of the page plus the onKeyUp event handlers in the input tags is what enables the behavior you see.

    Being a bit familiar with the capabilities of JavaScript, I believe the functionality you are seeking is possible. However the $64,000 question is how to do it! I'll see what I can come up with but some of our colleagues may well already have a solution or two for you.