1

I'm trying to implement single line adress validation in my project. The suggestions work, except for the validation.

I get this error :

street-address?auth-token="mykey"&plugin=2.4.11&callback=jQuery19106555006508715451_1402992684064&street=As+Aquero+Rd%2C+Inarajan+GU&candidates=3&_=1402992684068
api.smartystreets.com
GET
401
Not authenticated.
text/plain
jquery-1.9.1.js:9597
Script
0 B
0 B
117 ms
116 ms

EVENT:RequestTimedOut (Request timed out)

The key works fine if I try it in the demo found at https://github.com/smartystreets/jquery.liveaddress. So if the key is not issue then what is it ?

  • 1
    Make sure your HTML key is associated with the hostname you're using the plugin with. So if "yoursite.com" is the domain name in the URL of the page, the HTML key needs to be associated with "yoursite.com" *exactly*. Or if it's "www.yoursite.com", that's different from "yoursite.com" – Matt Jun 17 '14 at 14:38
  • It works on the pages, but the main problem is that the auto-mapping is not working on the pop-up forms, any ideas ? Thnx. – user3545555 Jun 23 '14 at 15:52
  • Make sure mapping occurs *after* the pop-up form is visible on the page; the plugin will only map visible fields. – Matt Jun 23 '14 at 15:53
  • EDIT: The auto-mapping was the problem. Got it to work with manual mapping, like this: var liveaddress = $.LiveAddress({ key: json.key, debug: true, autoVerify: true, invalidMessage: "That address is not valid", addresses: [{street: json.addresses}] }); – user3545555 Jun 26 '14 at 08:39
  • However street for some reason doesn't like that json.addresses is an array and it works for a single form selector.. and i need to pass multiple form selectors for the mapping because i want to use it in many forms, any ideas how i get around it ? – user3545555 Jun 26 '14 at 08:41
  • See the documentation for how to specify a field mapping. Each array element is an object mapping fields to input elements. – Matt Jun 26 '14 at 22:48
  • I will fix that , other problem hopefully the last one is that the verify button remains persistent on the main page when i close the pop-up form .. :( couldn't find any solution online – user3545555 Jun 27 '14 at 13:31
  • You have to deactivate the address that goes away after it hides. There's a `deactivate` function to do this for you. You could also re-map fields depending on exactly what you want to do. – Matt Jun 27 '14 at 14:19
  • Bingo @Matt! Added `yoursite.com` and `www.yoursite.com` to the same **Website Key | Auth ID**. – Bob Stein Feb 11 '15 at 14:16

0 Answers0