How to pass PHP variables to a form?

  • Profile Image
    Kolloxviral
    Asked on January 19, 2017 at 11:17 AM

    Hello,

     

    I would like to pass a number(purchase number)into a form and then send the user to a jotform form where the user will either choose a country, according to his country charge the right amount of V.A.T then check out.

     

    Could you please let me know how to pass a variable in php to the form data.

     

    Thank you.

     

     

  • Profile Image
    AIDAN
    Answered on January 19, 2017 at 12:28 PM

    Hi, thank you for contacting us.

    Your request, as per my understanding, involves prepopulating form fields. If so, please consider following our detailed guide on how to prepopulate fields to your JotForm via URL parameters here: https://www.jotform.com/help/71-Prepopulating-Fields-to-Your-JotForm-via-URL-Parameters

    Apologies in advance if I misunderstood your question. If you need further assistance please let us know. We will be happy to help. Thank you.

  • Profile Image
    Kolloxviral
    Answered on January 19, 2017 at 01:23 PM

    Hello,

     

    Thank you, I am ok repopulating normal html fields by simply passing dynamic values to the "value" elements but my problem is with Paypal, tax and countries.

     

    From my website the price and the product id will be passed via php but I need a form where the user can click his country and according to this country, add 18% tax to the final price(before paypal) for all EU countries or NO vat for any countriesoutside EU. Final cost will be price(passed via php) + Tax(according to the chosen country).

     

    If this is not possible to be done quickly with jotform I will have to hard code this purely in php and jquery.

     

    Just asking your support as you may have a quick approach to it.

     

    Thanks

  • Profile Image
    AIDAN
    Answered on January 19, 2017 at 02:05 PM

    Hi,

    Thank you for kindly providing more information on the task you have in mind.

    Upon examination of the tools and features our forms provide, I would say the quickest solution to achieve what you have in mind is through:

    1. Leveraging the form source code, in order to build up the concept of passing PHP data to it.

    2. Adding a dropdown menu for the countries, and assigning calculation values for the countries options that represent the tax percentage (18 vs 0)

    3. Setting up PayPal integration on the "User Defined Amount" payment type

    4. Calculating the price + tax as you explained above, into a field that will serve as the user defined field for the PayPal integration.

    Would that work for you?

  • Profile Image
    Kolloxviral
    Answered on January 19, 2017 at 03:05 PM

     

     

    I think I will hard code it from scratch as I do not see the big gain of time with Jotform on this particular case.

     

    Thanks for your explanations.

  • Profile Image
    jonathan
    Answered on January 19, 2017 at 04:58 PM

    Thank you for updating us on the status. Contact us again anytime for any assistance you need on JotForm.

    Regards