Question
AutoFill City & State by typing in ZipCode
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
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
