Address Locator does nothing

Discussion created by dougg on Apr 5, 2010
Latest reply on Apr 8, 2010 by MicahW
I'm fairly inexperienced with JavaScript so I set up a web site by mostly copying and pasting from examples. Everything works great except for calling the address locator. I know my locator is fine because when I go to my ArcGIS Services Directory, choose the locator service and click "Find Address Candidates", it finds the expected candidates. However, in the code it does nothing. I put an OnError statement for the dojo connect and I get an error but don't know how to use that error to get anything useful. The JavaScript console in firefox lists no errors and without that onError, nothing happens when I try locating my address.
Here are the  relevant parts of the code - it is just copied from other's examples. The syntax of my locator is correct as far as I can tell. The locator is a US One Range - all address info is in one field (Street). The address info comes from two user inputs - I have tested those and they work fine for setting the "useraddr" variable.

locator = new esri.tasks.Locator("");

        dojo.connect(locator, "onAddressToLocationsComplete", showResults);
        dojo.connect(locator, "onError", error);

function locate() {;

        var useraddr = dojo.byId("streetnum").value + " " + dojo.byId("streetname").value;
        var address =
          Street: useraddr



in the <body>:
<input type="button" value="Locate" onclick="locate()" />