Set form conditions for delivery limit

  • mytotalblend
    Asked on November 3, 2021 at 2:11 AM

    Hello,

    How can I create a conditional logic formula on my order form for the following reason?

    When the customer enters their zip code, I need to set the delivery limit up to 50 miles from the Atlanta, GA zip code 30303.

    (We will be delivering to all of Atlanta and surrounding metro counties up to 50 miles.)

  • Billy JotForm Support
    Replied on November 3, 2021 at 6:19 AM

    Hello,

    I hope you're doing well and thanks for reaching out.

    You can use a widget called the Driving Distance widget to calculate the distance from Atlanta, GA to point B. See the screenshot below:

    1635934357 618260958d3c6  Screenshot 10

    Please note however that this requires Google Maps API key to work

    1635934384 618260b014e95  Screenshot 21

    Once you've done that, you add a condition that looks like this(or in any way you prefer)

    1635934713 618261f93318a  Screenshot 32

    Let us know if you need further assistance.

    Best regards,

  • Billy JotForm Support
    Replied on November 3, 2021 at 6:21 AM

    If you don't have a Google Maps API key, you may want to use Jotform Approvals instead of using form conditions.

    If you see that the address they provided cannot be serviced, you can deny the request and include the reason why. Click here to learn more about Jotform Approvals.

  • mytotalblend
    Replied on November 4, 2021 at 12:33 PM

    Thank you for the instructions.

    Now, I have another issue with the same function.

    I am testing the Driving Distance Widget on my form, and when I try to enter the (city, state, zip code), the function does not allow me to enter anything.

    Please let me know what my error is.

    Thank you.

  • Samuel_Ray Jotform Support
    Replied on November 4, 2021 at 3:58 PM

    Hi there,

    I tried replicating the issue that you're getting. And I was able to get it as well. I dig through your widget's settings and found out that the issue is with the widget's API key.

    I tried to put the same widget on one of my forms and used your API key and it didn't work. I then tried creating my own Google Maps API Key and it worked fine.

    1636055687 61843a8720b2c  Screenshot 10

    It's possible that your API Key is not valid anymore. I would suggest that you try to generate another one and use this in your form. You can follow this guide from google in generating your own API key: https://developers.google.com/maps/documentation/javascript/get-api-key

    I hope this helps. Please don't hesitate to get back to us if you have any other questions.