Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

AutoFill City & State by typing in ZipCode

Contributor ,
Aug 14, 2007 Aug 14, 2007
Here is a great example of using AJAX to automatically lookup the City & State by just typing in the Zip Code.
Problem is I cannot get it to work? I type in the Zip code & nothing happens to the City & State fields?
Since the XML code works fine I'm sure the issue is with my Ajax code on my Main Form (listed below) and how I'm assigning the values to the variables & then to my Form fields..?

I have attached the code to my files below:
1) Part of the Dreamweaver form code that has the AJAX code & my Form fields.
- Here is a link to my site: http://www.clearwave.biz/Beta/T1COElogin.cfm (username is: Beta password is: 123) Click on the "Add New T1" button to see my Main form and View Source to my full Form code.
2) The getZipInfo.cfm code that creates the XML data.
- Here is a link to the getZipInfo.cfm file:
I tested it using http://www.clearwave.biz/Beta/getZipInfo.cfm?URL.zip=62948 & got back the correct XML values for that Zip so I know the XML is working fine.

I’m using : onblur="updateCityState();" on my T1BusZip field on my Form like this:
<tr>
<td class="KT_th"><label for="T1BusZip">Zipcode:</label></td>
<td colspan="2"><input name="T1BusZip" onBlur="updateCityState();" id="T1BusZip" value="<cfoutput>#Request.KT_escapeAttribute(rstblT1OrderProcessing2.T1BusZip)#</cfoutput>" size="32" wdg:subtype="MaskedInput" wdg:mask="99999" wdg:restricttomask="yes" wdg:type="widget" />
<cfoutput>#tNGs.displayFieldHint("T1BusZip")#</cfoutput> <cfoutput>#tNGs.displayFieldError("tblT1OrderProcessing2", "T1BusZip")#</cfoutput> </td>
</tr>


ps: Here is the link to the original source of this project: http://jamesedmunds.com/testing123/ajaxtest2.cfm

Thanks for any assistance,
jlig
TOPICS
Server side applications
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 09, 2010 Nov 09, 2010
LATEST

This post may help: http://nerdbombs.wordpress.com/2010/11/03/zipcode/

It uses Ajax and a php array to automatically display the city and state after a user enters their zip code in a form.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines