How are products handled in the source code?

  • Profile Image
    Asked on April 29, 2014 at 06:43 PM



    I am customizing a form from y'all an intense amount, and I've managed to get pretty much all aspects of it working excluding one - products! 


    So I can have a product on the form, but the thing is I initially had about 7 forms set up, each with a different product (the prices are based on who the customer is, and to avoid having to field 1000 emails asking "why is my price different" I would like for the user to not know the prices other members have to pay). There is also a good deal of conditional logic.


    To that end, how would I add a product to the source code (including price obviously)? I need to set this value based on another, non-form element (which I can do using javascript, so don't worry about that) but essentially what I need to know is how does the source code and script know what product and price are being used? 


    (I included the website URL, but it is still in development. If the URL doesnt take you directly to the register page, jsut go ahead and click "Register" from the menu bar once the page finishes loading). 

  • Profile Image
    Answered on April 29, 2014 at 08:20 PM


    How would I add a product to the source code (including price obviously)?  

    ID's and Name are generated by our system when you add fields and other stuff in your form using our form builder you cannot just create your own field ID and Name as you need to build your form using the builder.

    So to add a product if you want to embed the form using its form source you have to modify again your form in our builder then grab a fresh copy of the form source. Any modification will be in Jotform's Builder. 

    That's how I understand your question let us know if that not what you are trying to accomplish.

  • Profile Image
    Answered on April 30, 2014 at 10:00 AM

    Well, that makes sense as your database needs to know what fields to be expecting.


    There has to be a predictable snippet of code that gets added to the source whenever an product gets added to the list of available options. I'm trying to avoid having to reformat the whole source code, as it took me some time to get the markup correct for my CSS. 

  • Profile Image
    Answered on April 30, 2014 at 10:50 AM

    You can sort of guess the generated code type based on looking at previous product ID's and Elements. However, that is not always a good idea since it is actually highly unpredictable unless you are cloning your form otherwise, it will be different anyhow. You can see what I mean if you compare them by looking through the generated sources.

    All of these are generated differently based on how you format or label your form fields and products and such. Additionally, as far as I know there really isn't a simpler way to do this as of yet other than to use the form's source or injected CSS since both of these offers a much better in-depth way of customizing anything on a form. So that is why it has been done this way for some time now.

    If we were to figure something out like that later down the road it would probably become optimized, but it's not a guarantee as to when or if it would happen unless our developers see it as beneficial in the long run. Did you have something more particular in mind for this? I can open up a feature request on your behalf if you wish.