Replacing address hint

We are placed in the Netherlands and have a different address format to the States. To make it easier we replaced the hint text with the appropriate text so we know in which fields to enter the correct information to get the right address format:


Street
Postcode City

Country


We used this code and it works like a charm!


$(document).on('knack-scene-render.any', function(event, scene) {
$(".kn-input-address label[for='street']").text("Straat");
$(".kn-input-address label[for='street2']").text("");
$(".kn-input-address label[for='city']").text("");
$(".kn-input-address label[for='state']").text("Postcode");
$(".kn-input-address label[for='zip']").text("Stad");
$(".kn-input-address label[for='country']").text("Land");
$(".kn-input-address input[id='country']").attr("value", "Nederland");

});

Thanks for noticing Brian but this creates the right format for a dutch address.

For anyone who's interested, we also added this css code to hide the fields we don't need and adjust the size of the zip field!
.kn-input-address .address-international #street2 {display: none; }
.kn-input-address .address-international #city {display: none; }
.kn-input-address .address-international #zip {width: 240px !important; }

.kn-input-address .address-us #street2 {display: none; }
.kn-input-address .address-us #city {display: none; }

Thanks for this, James. Just noticed the zip and state substitutions should be switched, but I'm sure you caught it.

Thanks for sharing James - that's great!