Autocomplete Address Validation

So, I had never used the Address Input from the Editor before, I was playing around and there is no way of using custom validation to validate the address because you cannot compare the values, they will always be the same, even after onChange() . Address Inputs also don’t have style properties that we could use to create a custom validation indication. So, the best solution would be this one:

$w.onReady(() => {
    $w('#addressInput1').onChange(({ target: { value } }) => {
        value.location === undefined ? $w('#btnOk').disable() : $w('#btnOk').enable()
    })
})

There is also a delay between the value you select and the input being filled by the selected option, and that gets in the way.

Just check if one of the values properties (not formatted) is undefined, in my example I used the location property, and if it is, disable the button that saves the information (remember to put the button disabled on load). If not, enable the button and everything will be saved correctly.