In the Netherlands, it's common for forms with address fields to try and autocomplete the street and city based on the zipcode and house number.
Using Alpine.js
In order to achieve this with Alpine, we would have to trigger the fetching of the data when the user has filled in the zipcode and house number field. Then, the result should be set on the address and city fields. We can do this with the @input event listener.
We will listen on both fields and then execute handle the lookup in a separate function called getAddress.
The function gets three values. One holds the Alpine data which we need to later modify the data with the results fetch from the API. The other two are the values from the zipcode and the house number fields.
Address API
There are several commercial API's that provide you with a way to look up address information, but there is a free API from the government as well.
The function to fetch the address is async, because we need to wait for the API response. We also do some basics checks, because we don't want to send requests when the fields are incomplete. We also make sure the zipcode contains 6 characters. This all could be further polished up.