Skip to content

Commit

Permalink
Fix labels in format response (#21)
Browse files Browse the repository at this point in the history
* Fix labels in format response

* fix comment

---------

Co-authored-by: Georgi Dobrilov <[email protected]>
  • Loading branch information
gdobrilov and GeorgiDobrilov authored May 30, 2024
1 parent 06d1ece commit 7707694
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions dist/js/experian-address-validation.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/existing-form-fields/input-and-output.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ <h1>Experian Address Validation</h1>
<label for="address_line_2">Address line 2</label>
<input type="text" name="address_line_2" id="address_line_2">

<label for="locality">City</label>
<label for="locality">Locality</label>
<input type="text" name="locality" id="locality">

<label for="region">State</label>
<label for="region">Region</label>
<input type="text" name="region" id="region">

<label for="postal_code">ZIP code</label>
<label for="postal_code">Postal code</label>
<input type="text" name="postal_code" id="postal_code">

<label for="country">Country</label>
Expand Down
6 changes: 3 additions & 3 deletions examples/existing-form-fields/output-only.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ <h1>Experian Address Validation</h1>
<label for="address_line_2">Address line 2</label>
<input type="text" name="address_line_2" id="address_line_2">

<label for="locality">City</label>
<label for="locality">Locality</label>
<input type="text" name="locality" id="locality">

<label for="region">State</label>
<label for="region">Region</label>
<input type="text" name="region" id="region">

<label for="postal_code">ZIP code</label>
<label for="postal_code">Postal code</label>
<input type="text" name="postal_code" id="postal_code">

<label for="country">Country</label>
Expand Down
12 changes: 6 additions & 6 deletions examples/long-form/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ <h3>1. Delivery address</h3>
<input id="add3" name="add3" type="text" autocomplete="new-password" autofill="off">
</div>
<div class="form-field">
<label for="city">City</label>
<label for="city">Locality</label>
<input id="city" name="city" type="text" autocomplete="new-password" autofill="off">
</div>
<div class="form-field">
<label for="state">State</label>
<label for="state">Region</label>
<input id="state" name="state" type="text" autocomplete="new-password" autofill="off">
</div>
<div class="form-field">
<label for="zip">ZIP code</label>
<input id="zip" name="zip" type="text" autocomplete="new-password" autofill="off">
<label for="postal">Postal code</label>
<input id="postal" name="postal" type="text" autocomplete="new-password" autofill="off">
</div>

<h3>2. Your details</h3>
Expand Down Expand Up @@ -206,13 +206,13 @@ <h3>Order summary</h3>
var options = {
searchType: 'validate',
elements: {
inputs: [document.querySelector("#add1"), document.querySelector("#add2"), document.querySelector("#add3"), document.querySelector("#city"), document.querySelector("#state"), document.querySelector("#zip")],
inputs: [document.querySelector("#add1"), document.querySelector("#add2"), document.querySelector("#add3"), document.querySelector("#city"), document.querySelector("#state"), document.querySelector("#postal")],
address_line_1: document.querySelector("#add1"),
address_line_2: document.querySelector("#add2"),
address_line_3: document.querySelector("#add3"),
locality: document.querySelector("#city"),
region: document.querySelector("#state"),
postal_code: document.querySelector("#zip"),
postal_code: document.querySelector("#postal"),
countryList: document.querySelector("#country"),
lookupButton: document.querySelector("[name='commit']")
},
Expand Down
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ <h5 class="header">Enter postcode or locality, then get results</h5>
<label for="address_line_2">Address line 2</label>
<input type="text" name="address_line_2" id="address_line_2">

<label for="locality">City</label>
<label for="locality">Locality</label>
<input type="text" name="locality" id="locality">

<label for="region">State</label>
<label for="region">Region</label>
<input type="text" name="region" id="region">

<label for="postal_code">ZIP code</label>
<label for="postal_code">Postal code</label>
<input type="text" name="postal_code" id="postal_code">

<label for="country">Country</label>
Expand Down Expand Up @@ -158,4 +158,4 @@ <h2>Enrichment</h2>
<script src="dist/js/search-address-handling.js"></script>
<script src="dist/js/address-metadata-display.js"></script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/ts/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ export const translations = {
// language / country / property
en: {
gbr: {
locality: 'Town/City',
region: 'County',
postal_code: 'Post code'
locality: 'Locality',
region: 'Region',
postal_code: 'Postal code'
},
usa: {
locality: 'City',
region: 'State',
postal_code: 'ZIP code'
locality: 'Locality',
region: 'Region',
postal_code: 'Postal code'
}
}
// Add other languages below
Expand Down

0 comments on commit 7707694

Please sign in to comment.