So while LiveAddress works great for US address we have to support international addresses as well. I already have a country dropdown that's enabling LiveAddress only when the person chooses the US. However I need to now "disable" LiveAddress anytime someone picks a country other than the US.
$(".chosen-select").on("change", function (e) {
if (e.added.id == "USA") {
showUSStates();
$.LiveAddress("<My Key>");
} else if (e.added.id == "CAN") {
showCANProvinces();
//Disable Live Address here?
} else {
//Disable Live Address here?
$("label[for=State]").html("Province");
$("#State").hide()
$("#Province").show()
$("#State").empty();
}
});
Thanks!
Solution:
So it's not documented in their web pages but I read the unminimized js file and discovered that if you map the country field they library AUTOMATICALLY turns itself off once someone chooses a country other than US.
$(document).ready(function () {
showUSStates();
$.LiveAddress({
key: "<My Key>",
addresses: [{
id: 'billing',
street: '#Address1',
city: '#City',
state: '#State',
zipcode: '#PostalCode',
**country: '#Country'** }],
autoVerify: false
});
});
Great feature, just unfortunate that the online documentation doesn't detail this NOR did the online chat team know of this feature.