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

    Prepopulate a hidden or better visible text field with Javascript output?

    Asked by kotzilla on October 23, 2014 at 09:33 PM

    Dear support,

    We are specialist plant nursery with a very basic but good enough javascript shopping cart that doesn't allow a proper checkout (ISP has no PHP or whatoever).

    All it does is to write the contents nicely arranged on the screen and the customer will copy and paste it into an e-mail himself. Sort of embarrassing :-)

    Now it seems Jotform might be a good solution.

    I created a nice form collecting all the address and contact data and it would be nice to prepopulate one large text field with the shopping cart contents above and include it into the jotform submit-e-mail.

    The shopping cart appears with the following command on our website and generates about 6-20 lines of text:

        <SCRIPT>

            CheckoutCart();

     

        </SCRIPT>

     

    Now, how to get the output of that script into a Jotform textbox (perfect would be visible but not editable, but hidden would be ok as well). We don't need any online payments, as the cart is still subject to verification (live plants!).

    Thanks a bunch!

    Volker

    PS: The website link doesn't show the jotform yet (source code commented out) as it is in active use by our customers.

    Page URL:
    www.pitcher-plants.com

    text field hidden JotForm source name
  • Profile Image
    JotForm Support

    Answered by ashwin_d on October 24, 2014 at 01:04 AM

    Hello Volker,

    I am not sure if I have understood your question correctly.

    What does the script code return? Is it an HTML or normal text content or it returns an array object? I did try to check your website for more understanding but could not find any checkout option there. 

    If your script code returns text then you can take advantage of our "URL parameter" feature to pre-populate any of your JotForm fields. The following guide should help you on how to use URL parameter:  http://www.jotform.com/help/71-Prepopulating-fields-to-your-JotForm-via-URL-parameters 

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!

  • Profile Image
    JotForm Support

    Answered by ashwin_d on October 24, 2014 at 01:06 AM

    Hello Volker,

    I also wanted to update you that calling the "Checkout" function needs to be done in your own web page and the use the URL parameter to pre-populate the form fields. Please be noted that it is not possible to add any sort of script code in your form editor.

    Thank you!

  • Profile Image

    Answered by kotzilla on October 24, 2014 at 01:15 AM

    Hi Ashwin,

    That's the problem. I am very inexperienced with Java script, just putting ready made things without perfect understanding together.

    So for the output type I am not sure :-)

    Maybe you can go to the website, click the 'visit plants' button and then use the pink shopping cart button to get to the check-out. The jot-form is also already there.

    I saw the link that you provided earlier, but didn't fully understand it.

    Thanks for your help!

  • Profile Image

    Answered by kotzilla on October 24, 2014 at 01:22 AM

     

  • Profile Image

    Answered by kotzilla on October 24, 2014 at 01:56 AM

    PS: I am not using the automated Jotform thing, but got the source code and pasted it into my html and did also the fine adjustment in the midst of my HTML file.

  • Profile Image
    JotForm Support

    Answered by ashwin_d on October 24, 2014 at 03:17 AM

    Hello kotzilla,

    Thank you for the information on how to check your checkout page. 

    I am not sure if it is possible to dynamically read the data and pre-populate the JotForm field. I will play with your form and shopping cart and see if there is any possibility or workaround available. 

    I cannot assure if if that would be possible not I can give you an ETA on this but I will get back to you with an answer soon.

    Thank you!

  • Profile Image

    Answered by kotzilla on October 24, 2014 at 05:10 AM

    Hi Ashwin,

    Thanks for taking the time - I am very grateful. I seems as if it is just a small step lacking to the perfect solution.

    Will also try to further understand and learn about it :-)

    Thanks,

    Volker

  • Profile Image
    JotForm Support

    Answered by ashwin_d on October 24, 2014 at 06:18 AM

    Hello Volker,

    You are welcome.

    I will get back to you on this soon.

    Thank you!