I have an LWC component that has lightning-input-address with show-address-lookup, I have kept all the fields read-only except the address search. When I search address and press the save button then get an error bad value picklist for country/territory. I have selected the United States and it shows bad value. Can anyone tell me what actually it has to be passed? I know it wants value like Ind, US but how I can pass this?
You can review below component:
HTML:
<lightning-input-address if:true={showShippingAdd} required class="slds-size_6-of-12" style="margin-left: 5%;"
address-label="Address Test"
read-only
street-label="Street Test "
city-label="City Test"
country-label="Country Test"
province-label="Province Test"
postal-code-label="PostalCode Test"
street={shipToStreet}
city={shipToCity}
province={shipToState}
postal-code={shipToPostalCode}
country={shipToCountry}
onchange={handleShippingAddChg}
show-address-lookup ></lightning-input-address>
Js:
handleShippingAddChg(event) {
console.log("event.detail--- >> ", event.detail);
console.log("event.target--- >> ", event.target);
console.log("street >> ", event.detail.street);
console.log("city >> ", event.detail.city);
console.log("state >> ", event.detail.province);
console.log("postalcode >> ", event.detail.postalCode);
console.log("country >> ", event.detail.country);
console.log("country2 >> ", event.target.country);
this.shipToStreet = event.detail.street;
this.shipToCity = event.detail.city;
this.shipToState = event.detail.province;
this.shipToCountry = event.detail.country;
here country >> is coming as United States but i want to pass the value