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.
Driving Distance Widget: Converting Kilometers to meters when distance is less then 1 KmAsked by rbroadfo on February 16, 2016 at 10:51 AM
Hello. The 'From' field in my Driving Distance Widget is read-only, it's my business address. The 'To' field is the customer's address. The resulting distance is used in the Calculation Wizard to calculate travel fees over 30km.
I received a form submission with two errors:
(1) The 'From' field and the "To' field were the same, and
(2) The Calculation Wizard showed a travel fee, even though there was no distance.
Please see the screen shot of that form submission.
I checked your form and the widget, first I think there is an error with the "From" address, this is the address that the form has.
I checked the widget and that is the address that it has. Could be possible to add the correct address again?
Then, once the address is corrected, we will make some tests to see how it's working and try to replicate your issue in our end.
The 'From' address is a Postal Code (used in Canada) and it's worked every other time. The 'From' address was the same as the 'To' address, so I'm quite certain it didn't have to do with the 'From' address only containing the postal code.
I checked it and now it's calculating the correct value, this is my result.
You may show the calculation wizard, make some tests and check if it's taking the correct value. If you do not want that your users enter the same address that is in "From", then you may add a validation using conditions, if they are the same the result should be 0, then you may show a message indicating that the addresses can not be equal.
You've shown that you cannot replicate the error. I was not able to replicate the error either. But it happened as can be seen in the screen shot of the form submission. The 'From' address - which is read-only, populated with the 'To' address. I am not confident this will not happen again. If it happens again, the customers will think there is a travel fee when there is not. This will effect sales.
I tried to replicate the problem in your end. I believe the problem is that the distance output is now showing meters if it is less than 1 Km.
Here's how I replicated it:
I changed the event address exactly the same shown in your sample submission, I presume you have already updated it in your latest version. You'll see that the distance is 61 meters.
Your condition states that if it is greater than 30 (or in your latest version of the form its 25), it should do a calculation. 61 is greater than 25/30 which is why the condition is still true.
Calculation will be:
= ( (61 - 30 ) * 6.00 )
Now I am not sure how we can proceed on this. Technically, if it is less than 1 Km, it would be good to display the distance on meters. However, that is causing problems in your conditional logic. I'm thinking it should just stay on "Kilometers" because there's an option to have it in that units, it should strictly be like that and not change to meters. So the expected output should be like 0.61 Km.
Let us know us know if my observations are correct and if you agree on having it stayed on Km instead, I'll forward this issue to our widget team if that's the case. Apologies for the inconvenience.