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

    Hardcoding Jotform on a web page

    Asked by deluca on August 21, 2012 at 05:16 AM

    Hi,

     

    I am going to hardcode Jotform to my website, I would like to know a few things please.

     

     

    Let's say I have over 100 products(which I have), if a price changes in one of those products, do I just need to change the:

    ({"input_25_1031":{"price":"9.50","quantityField":"input_25_quantity_1031_0"},

    I Understand the "Input 25" but not the "quantity_1031_0 <----what does it means please?

     

     

    Also, If I want to manually add a new product, which fields shall I change please? I understand that I have to set the variables at the top of the page, then which variables have to be changed in the form itself?

     

    <span class="form-product-item"><img src="//sitelllllll.com/wp-content/themes/shopperpress/thumbs/images/top-banners/pie.png" class="form-product-image-with-options" height="50" width="50" align="absmiddle" />
                <input class="form-checkbox validate[required]" type="checkbox" id="input_25_1005" name="q25_ourPizzas[][id]" value="1005" />
                <label for="input_25_1005">
                  <b>
                    RabbitPie
                  </b><span class="form-product-details"><b>
                      &euro;<span id="">4.00</span>
                      EUR
                    </b></span>
                </label>
                <br />
                <br /><span class="form-sub-label-container"><select class="form-dropdown validate[required]" name="q25_ourPizzas[special_1005][item_0]" id="input_25_quantity_1005_0">
                    <option value="0"> 0 </option>
                    <option value="1"> 1 </option>
                    <option value="2"> 2 </option>
                    <option value="3"> 3 </option>
                    <option value="4"> 4 </option>
                    <option value="5"> 5 </option>
                    <option value="6"> 6 </option>
                    <option value="7"> 7 </option>
                    <option value="8"> 8 </option>
                    <option value="9"> 9 </option>
                    <option value="10"> 10 </option>
                  </select>
                  <label class="form-sub-label" for="input_25_quantity_1005_0"> Quantity </label></span></span>
              <br />

     

     

    Shall I just add:

    input_25_1005":{"price":"4.00","quantityField":"input_25_quantity_1005_0"}

     

    Are all the input_25_1005 and input_25_quantity_1005_0 generated at random???? Can I just add anything I like?

     

     

    Is there anything else that needs to be changfed in order to have a new product added?

     

    Thank you,

     

     

    Ben

  • Profile Image
    JotForm Support

    Answered by idarktech on August 21, 2012 at 08:47 AM

    Hi Ben,

    Let's say I have over 100 products(which I have), if a price changes in one of those products, do I just need to change the:

    ({"input_25_1031":{"price":"9.50","quantityField":"input_25_quantity_1031_0"},

    I Understand the "Input 25" but not the "quantity_1031_0 <----what does it means please?

    input_25_1031 is the product ID (check box field) and the input_25_quantity_1031_0 is the product quantity ID (the dropdown field). They're both generated by JotForm and they can't be edited.

    Also, If I want to manually add a new product, which fields shall I change please? I understand that I have to set the variables at the top of the page, then which variables have to be changed in the form itself?

    Ben, I'm sorry to inform you but adding your own fields (html codes) will be useless. Every form ID's, fields are stored in your form database. If you'll add fields in your form though html codes, it wont be registered/recorded on your form email notification. Meaning, when your form user fill these fields it won't be captured. Please remember that you have to DO IT in the form builder to be able to make it work.

    Hope this information helps. Thank you!

  • Profile Image

    Answered by deluca on August 21, 2012 at 10:59 AM

    Hi Idarktech,

     

    Thank you for the info.

    Unfortunately, the way JotForm is at the moment will not let us add graphics, banners and other "must have" things between the products to create categories.

    It looks like I have no other choices than recreating the form and hardcode it each time..ouch.

     

    Thanks,

     

    Ben

  • Profile Image

    Answered by deluca on August 21, 2012 at 11:14 AM

    I have another question regarding hardcoding.

     

    At the moment, I have some product names and some prices, I have created entries for each but the names and prices will change in the future. Can I still change the prices and names in the hardcode?

     

    Regards,

     

     

    Ben

  • Profile Image
    JotForm Support

    Answered by jonathan on August 21, 2012 at 11:39 AM

    Hi Ben,

    As previously stated by my colleague Idarktech, simply put, if you wanted to change anything on the order field or payment field, you will have to go through the jotform builder before you get the source code and then manipulate the source code.

    Amending anything on the source code without passing throught the form builder will break the form, since it will have un-signed codes via the form builder.

    Thanks.

  • Profile Image

    Answered by deluca on August 21, 2012 at 11:54 AM

    Hi,

    Thank you,

     

    I see....

    But if for example 10 entries are done in the jotform admin panel.

    Can I add the source code, but then when a price changes, I modify the price on the html and then modify it in the JotForm admin panel, will this works? I can maybe keep everything in sync this way.

     

    Perhaps this is what you have been trying to explain above.

     

    Thank you,

     

    Ben

  • Profile Image

    Answered by jeanettebmz on August 21, 2012 at 04:37 PM

    Hello Ben

    If you just want to modify prices, this can be done in the form builder and once you update it, you would have to download its source code again  and apply the rest of customizations ( labels ,banners, etc)