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

    Input JavaScript into embedded code

    Asked by darren_jon on May 12, 2016 at 12:03 AM

    Hello,

    I had a question yesterday which was answered by Chriistian, pasted below. I have added that code into html on line 2048 with comments of how i believe it should work.  However not sure if this was the right place to put it or even if it was the right document, should it of gone into the main.js file somewhere?

    Thankyou

     

     

    Answered by Chriistian

     

    I checked the form on your webpage and it appears that you were able to successfully display the generated serial number into the text area of the form. However, upon checking the code, it appears that the text-area was not created from jotform, which is why it is not being displayed in the email response.

    A possible workaround would be to add another text area to your jotform. so you can pass the code from the code field seen above into a text area created in jotform. Then you can identify the id of the new text area and input the javascript below so you can fill it with a value using the javascript below

    var serialCode = document.getElementById("code").value;

    document.getElementById("mytextarea").value = serialCode";

    Please note that you can only add javascript to the form if you are using the full source code of your form. If you are using the full source, you will also need to re-embed the form everytime you make changes to it.

    If you need further assistance, please let us know.

    Page URL:
    http://cloud.coollockers.com/eng/Builder.html

    embedded code JotForm style source uploads
  • Profile Image
    JotForm Support

    Answered by EltonCris on May 12, 2016 at 02:47 AM

    In your script, you can actually set the textarea from your JotForm as the direct output field so you don't need to pass them from textarea to another textarea.

    Or, simply rename the textarea field ID from JotForm to "code" and delete your custom textarea field. So values from old textarea field will be automatically passed on the textarea field from JotForm.

    If you need further help, let us know.