Help with a code to calculate distance between 2 coordinates using Latitude and Longitude.

  • don’t do it when the $w is ready, but when the values are filled out.
    (I don’t know your use case. Maybe on dataset.onReady, maybe onInput).

And if it’s not an input element but a text element, do:
$w.onReady(() => {
$w(‘#dataset1’).onReady(() => {
const lat1 = Number($w(“#userLat”). text )
})
})