Re: which is the best way to do auto retrieval of Address...
thanx ppl!! problem solved! but hmm.. anyone know how to hide the popup.. under the parent page.. so that the user dun even know theres a pop up to generate it...??!! HAPPY MAN, han - Original Message - From: Steve Oliver [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Thursday, February 28, 2002 1:29 AM Subject: RE: which is the best way to do auto retrieval of Address... Yes you could do that, in the onchange paramater of the select box have it popup a new window. Do the query in that new window, then user the following javascript. script opener.formname.streetname = 'qry.StreetName'; opener.formname.city = 'qry.City'; /script If the form isn't named, and you only have 1 form on your page, you can use opener.forms[0].streetname Although this will cause a popup to show and disappear, I think a better way would be to just navigate to the same page with ?zip=12345 at the end of it. You'd have to cfparam all of your form fields this way, like cfparam name=thisform.FirstName default= Then in the form, input type=text name=FirstName value=#thisform.FirstName# At the top of the page you'd need to do something like. cfif isDefined(FORM.postalcode) cfset thisform = StructCopy(FORM) /cfif That will copy everything submitted through the form into the thisform structure, so if they filled out half of the form before selecting a postal code, it will load it all in the form. _ steve oliver senior internet developer atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: han peng [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 2:19 AM To: CF-Talk Subject: Re: which is the best way to do auto retrieval of Address... hmm.. are u saying... upon selected a postal code.. i callup a popup page which will perform a cfquery and do a matching... then pass back the matched value back to parent?? can I do that..?? if can... how shld i pass the value to and fro child and parent page...?? cheers han - Original Message - From: Robert Obreczarek [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 2:44 PM Subject: RE: which is the best way to do auto retrieval of Address... How about using frames? maybe an iframe/ilayer. that way you could click on a name, and the info would pop in a another frame Robert -Original Message- From: han peng [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:13 PM To: CF-Talk Subject: which is the best way to do auto retrieval of Address... hi... i need to do a address input fields.. where customer can choose their postal code.. and his house number and streetname will be retrieved out automatically... the codes below actually can do the work.. but because theres about 100,000 data to be put into array...so it took almost like a minute to load a page sigh... anyone have a better idea.? i did it this way coz customer wan to retrieve the data instantly.. thanx han Javascript function: function display_Street(box1, box2) { var TotalStreetArray = box2.length; for(i=0; iTotalStreetArray; i++) { if(box2[i][0] == box1) { document.form.strStreetName.value = box2[i][1]; document.form.strBlockNumber.value = box2[i][2]; } } } !--- Database Queries --- CFQUERY name=PostalCode_list datasource=#request.DSN# cachedwithin=#CreateTimeSpan(0, 6, 0, 0)# SELECT a.strPostalCode, a.strBlockNumber, b.strStreetName From tblPostalCode a, tblStreet b WHERE a.strStreetNumber = b.strStreetNumber ORDER BY a.strPostalCode /CFQUERY cfset StreetName_array = arraynew(2) CFSET i =1 CFLOOP query=PostalCode_list cfset StreetName_array[i][1] = #trim(strPostalCode)# cfset StreetName_array[i][2] = #trim(strStreetName)# cfset StreetName_array[i][3] = #trim(strBlockNumber)# CFSET i = i + 1 /CFLOOP CFWDDX INPUT=#StreetName_array# OUTPUT=MyWDDXPacket ACTION=CFML2WDDX CFWDDX INPUT=#MyWDDXPacket# OUTPUT=DynamicJSCode ACTION=WDDX2JS TOPLEVELVARIABLE=StreetName_array scriptcfoutput#DynamicJSCode#/cfoutput/script table width=100% border=0 cellspan=0 tr td width=5%BLK/HSE NO./td td width=25%cfinput type=text name=strBlockNumber size=5 maxlength=5 message=Please enter your Block / House Number. required=Yes onerror=setFocus value=#session.prospect.strBlockNumber#/td td width=5%FLR./td td width=25%cfinput type=text name=strFloorNumber size=5 maxlength=5 message=Please enter your Floor Number. required=No value=#session.prospect.strFloorNumber#/td td width=5%UNIT/td td width=25%cfinput type=text name=strUnitNumber size=5 maxlength=5 message=Please enter your Unit Number. required=No value=#session.prospect.strUnitNumber#/td td
RE: which is the best way to do auto retrieval of Address...
Yes you could do that, in the onchange paramater of the select box have it popup a new window. Do the query in that new window, then user the following javascript. script opener.formname.streetname = 'qry.StreetName'; opener.formname.city = 'qry.City'; /script If the form isn't named, and you only have 1 form on your page, you can use opener.forms[0].streetname Although this will cause a popup to show and disappear, I think a better way would be to just navigate to the same page with ?zip=12345 at the end of it. You'd have to cfparam all of your form fields this way, like cfparam name=thisform.FirstName default= Then in the form, input type=text name=FirstName value=#thisform.FirstName# At the top of the page you'd need to do something like. cfif isDefined(FORM.postalcode) cfset thisform = StructCopy(FORM) /cfif That will copy everything submitted through the form into the thisform structure, so if they filled out half of the form before selecting a postal code, it will load it all in the form. _ steve oliver senior internet developer atnet solutions, inc. http://www.atnetsolutions.com -Original Message- From: han peng [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 2:19 AM To: CF-Talk Subject: Re: which is the best way to do auto retrieval of Address... hmm.. are u saying... upon selected a postal code.. i callup a popup page which will perform a cfquery and do a matching... then pass back the matched value back to parent?? can I do that..?? if can... how shld i pass the value to and fro child and parent page...?? cheers han - Original Message - From: Robert Obreczarek [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 2:44 PM Subject: RE: which is the best way to do auto retrieval of Address... How about using frames? maybe an iframe/ilayer. that way you could click on a name, and the info would pop in a another frame Robert -Original Message- From: han peng [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:13 PM To: CF-Talk Subject: which is the best way to do auto retrieval of Address... hi... i need to do a address input fields.. where customer can choose their postal code.. and his house number and streetname will be retrieved out automatically... the codes below actually can do the work.. but because theres about 100,000 data to be put into array...so it took almost like a minute to load a page sigh... anyone have a better idea.? i did it this way coz customer wan to retrieve the data instantly.. thanx han Javascript function: function display_Street(box1, box2) { var TotalStreetArray = box2.length; for(i=0; iTotalStreetArray; i++) { if(box2[i][0] == box1) { document.form.strStreetName.value = box2[i][1]; document.form.strBlockNumber.value = box2[i][2]; } } } !--- Database Queries --- CFQUERY name=PostalCode_list datasource=#request.DSN# cachedwithin=#CreateTimeSpan(0, 6, 0, 0)# SELECT a.strPostalCode, a.strBlockNumber, b.strStreetName From tblPostalCode a, tblStreet b WHERE a.strStreetNumber = b.strStreetNumber ORDER BY a.strPostalCode /CFQUERY cfset StreetName_array = arraynew(2) CFSET i =1 CFLOOP query=PostalCode_list cfset StreetName_array[i][1] = #trim(strPostalCode)# cfset StreetName_array[i][2] = #trim(strStreetName)# cfset StreetName_array[i][3] = #trim(strBlockNumber)# CFSET i = i + 1 /CFLOOP CFWDDX INPUT=#StreetName_array# OUTPUT=MyWDDXPacket ACTION=CFML2WDDX CFWDDX INPUT=#MyWDDXPacket# OUTPUT=DynamicJSCode ACTION=WDDX2JS TOPLEVELVARIABLE=StreetName_array scriptcfoutput#DynamicJSCode#/cfoutput/script table width=100% border=0 cellspan=0 tr td width=5%BLK/HSE NO./td td width=25%cfinput type=text name=strBlockNumber size=5 maxlength=5 message=Please enter your Block / House Number. required=Yes onerror=setFocus value=#session.prospect.strBlockNumber#/td td width=5%FLR./td td width=25%cfinput type=text name=strFloorNumber size=5 maxlength=5 message=Please enter your Floor Number. required=No value=#session.prospect.strFloorNumber#/td td width=5%UNIT/td td width=25%cfinput type=text name=strUnitNumber size=5 maxlength=5 message=Please enter your Unit Number. required=No value=#session.prospect.strUnitNumber#/td td width=5%nbsp;/td td width=5%nbsp;/td /tr tr tdST/td td colspan =3cfinput type=text name=strStreetName size=50 maxlength=50 message=Please enter your Street Name. required=Yes onerror=setFocus value=#session.prospect.strStreetName#/td tdBLDG/td td colspan =3cfinput type=text name=strBuildingName size=50 maxlength=50 message=Please enter your Building Name. required=No value=#session.prospect.strBuildingName#/td /tr tr
Re: which is the best way to do auto retrieval of Address...
http://www.ashleyit.com/rs/main.htm jon - Original Message - From: han peng [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 1:13 AM Subject: which is the best way to do auto retrieval of Address... hi... i need to do a address input fields.. where customer can choose their postal code.. and his house number and streetname will be retrieved out automatically... the codes below actually can do the work.. but because theres about 100,000 data to be put into array...so it took almost like a minute to load a page sigh... anyone have a better idea.? i did it this way coz customer wan to retrieve the data instantly.. thanx han Javascript function: function display_Street(box1, box2) { var TotalStreetArray = box2.length; for(i=0; iTotalStreetArray; i++) { if(box2[i][0] == box1) { document.form.strStreetName.value = box2[i][1]; document.form.strBlockNumber.value = box2[i][2]; } } } !--- Database Queries --- CFQUERY name=PostalCode_list datasource=#request.DSN# cachedwithin=#CreateTimeSpan(0, 6, 0, 0)# SELECT a.strPostalCode, a.strBlockNumber, b.strStreetName From tblPostalCode a, tblStreet b WHERE a.strStreetNumber = b.strStreetNumber ORDER BY a.strPostalCode /CFQUERY cfset StreetName_array = arraynew(2) CFSET i =1 CFLOOP query=PostalCode_list cfset StreetName_array[i][1] = #trim(strPostalCode)# cfset StreetName_array[i][2] = #trim(strStreetName)# cfset StreetName_array[i][3] = #trim(strBlockNumber)# CFSET i = i + 1 /CFLOOP CFWDDX INPUT=#StreetName_array# OUTPUT=MyWDDXPacket ACTION=CFML2WDDX CFWDDX INPUT=#MyWDDXPacket# OUTPUT=DynamicJSCode ACTION=WDDX2JS TOPLEVELVARIABLE=StreetName_array scriptcfoutput#DynamicJSCode#/cfoutput/script table width=100% border=0 cellspan=0 tr td width=5%BLK/HSE NO./td td width=25%cfinput type=text name=strBlockNumber size=5 maxlength=5 message=Please enter your Block / House Number. required=Yes onerror=setFocus value=#session.prospect.strBlockNumber#/td td width=5%FLR./td td width=25%cfinput type=text name=strFloorNumber size=5 maxlength=5 message=Please enter your Floor Number. required=No value=#session.prospect.strFloorNumber#/td td width=5%UNIT/td td width=25%cfinput type=text name=strUnitNumber size=5 maxlength=5 message=Please enter your Unit Number. required=No value=#session.prospect.strUnitNumber#/td td width=5%nbsp;/td td width=5%nbsp;/td /tr tr tdST/td td colspan =3cfinput type=text name=strStreetName size=50 maxlength=50 message=Please enter your Street Name. required=Yes onerror=setFocus value=#session.prospect.strStreetName#/td tdBLDG/td td colspan =3cfinput type=text name=strBuildingName size=50 maxlength=50 message=Please enter your Building Name. required=No value=#session.prospect.strBuildingName#/td /tr tr tdPD/td tdcfSELECT name=strPostalName display=strPostalCode value=strPostalCode query=postalCode_list size=1 message=Please choose your Postal Code. required=Yes onerror=setFocus Selected=#session.prospect.strPostalName# onChange=display_Street(this.options[this.selectedIndex].value, StreetName_array);/CFSELECT/td tdTYPE/td tdcfselect name=strAddressType message=Please enter your Housing Type. required=Yes onerror=setFocus Selected=#session.prospect.strAddressType# size=1 option value=A cfif #session.prospect.strAddressType# eq 'A'SELECTED/cfifA/option option value=B cfif #session.prospect.strAddressType# eq 'B'SELECTED/cfifB/option /cfselect/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td /tr /table __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: which is the best way to do auto retrieval of Address...
How about using frames? maybe an iframe/ilayer. that way you could click on a name, and the info would pop in a another frame Robert -Original Message- From: han peng [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:13 PM To: CF-Talk Subject: which is the best way to do auto retrieval of Address... hi... i need to do a address input fields.. where customer can choose their postal code.. and his house number and streetname will be retrieved out automatically... the codes below actually can do the work.. but because theres about 100,000 data to be put into array...so it took almost like a minute to load a page sigh... anyone have a better idea.? i did it this way coz customer wan to retrieve the data instantly.. thanx han Javascript function: function display_Street(box1, box2) { var TotalStreetArray = box2.length; for(i=0; iTotalStreetArray; i++) { if(box2[i][0] == box1) { document.form.strStreetName.value = box2[i][1]; document.form.strBlockNumber.value = box2[i][2]; } } } !--- Database Queries --- CFQUERY name=PostalCode_list datasource=#request.DSN# cachedwithin=#CreateTimeSpan(0, 6, 0, 0)# SELECT a.strPostalCode, a.strBlockNumber, b.strStreetName From tblPostalCode a, tblStreet b WHERE a.strStreetNumber = b.strStreetNumber ORDER BY a.strPostalCode /CFQUERY cfset StreetName_array = arraynew(2) CFSET i =1 CFLOOP query=PostalCode_list cfset StreetName_array[i][1] = #trim(strPostalCode)# cfset StreetName_array[i][2] = #trim(strStreetName)# cfset StreetName_array[i][3] = #trim(strBlockNumber)# CFSET i = i + 1 /CFLOOP CFWDDX INPUT=#StreetName_array# OUTPUT=MyWDDXPacket ACTION=CFML2WDDX CFWDDX INPUT=#MyWDDXPacket# OUTPUT=DynamicJSCode ACTION=WDDX2JS TOPLEVELVARIABLE=StreetName_array scriptcfoutput#DynamicJSCode#/cfoutput/script table width=100% border=0 cellspan=0 tr td width=5%BLK/HSE NO./td td width=25%cfinput type=text name=strBlockNumber size=5 maxlength=5 message=Please enter your Block / House Number. required=Yes onerror=setFocus value=#session.prospect.strBlockNumber#/td td width=5%FLR./td td width=25%cfinput type=text name=strFloorNumber size=5 maxlength=5 message=Please enter your Floor Number. required=No value=#session.prospect.strFloorNumber#/td td width=5%UNIT/td td width=25%cfinput type=text name=strUnitNumber size=5 maxlength=5 message=Please enter your Unit Number. required=No value=#session.prospect.strUnitNumber#/td td width=5%nbsp;/td td width=5%nbsp;/td /tr tr tdST/td td colspan =3cfinput type=text name=strStreetName size=50 maxlength=50 message=Please enter your Street Name. required=Yes onerror=setFocus value=#session.prospect.strStreetName#/td tdBLDG/td td colspan =3cfinput type=text name=strBuildingName size=50 maxlength=50 message=Please enter your Building Name. required=No value=#session.prospect.strBuildingName#/td /tr tr tdPD/td tdcfSELECT name=strPostalName display=strPostalCode value=strPostalCode query=postalCode_list size=1 message=Please choose your Postal Code. required=Yes onerror=setFocus Selected=#session.prospect.strPostalName# onChange=display_Street(this.options[this.selectedIndex].value, StreetName_array);/CFSELECT/td tdTYPE/td tdcfselect name=strAddressType message=Please enter your Housing Type. required=Yes onerror=setFocus Selected=#session.prospect.strAddressType# size=1 option value=A cfif #session.prospect.strAddressType# eq 'A'SELECTED/cfifA/option option value=B cfif #session.prospect.strAddressType# eq 'B'SELECTED/cfifB/option /cfselect/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td /tr /table __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: which is the best way to do auto retrieval of Address...
hmm.. are u saying... upon selected a postal code.. i callup a popup page which will perform a cfquery and do a matching... then pass back the matched value back to parent?? can I do that..?? if can... how shld i pass the value to and fro child and parent page...?? cheers han - Original Message - From: Robert Obreczarek [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 2:44 PM Subject: RE: which is the best way to do auto retrieval of Address... How about using frames? maybe an iframe/ilayer. that way you could click on a name, and the info would pop in a another frame Robert -Original Message- From: han peng [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:13 PM To: CF-Talk Subject: which is the best way to do auto retrieval of Address... hi... i need to do a address input fields.. where customer can choose their postal code.. and his house number and streetname will be retrieved out automatically... the codes below actually can do the work.. but because theres about 100,000 data to be put into array...so it took almost like a minute to load a page sigh... anyone have a better idea.? i did it this way coz customer wan to retrieve the data instantly.. thanx han Javascript function: function display_Street(box1, box2) { var TotalStreetArray = box2.length; for(i=0; iTotalStreetArray; i++) { if(box2[i][0] == box1) { document.form.strStreetName.value = box2[i][1]; document.form.strBlockNumber.value = box2[i][2]; } } } !--- Database Queries --- CFQUERY name=PostalCode_list datasource=#request.DSN# cachedwithin=#CreateTimeSpan(0, 6, 0, 0)# SELECT a.strPostalCode, a.strBlockNumber, b.strStreetName From tblPostalCode a, tblStreet b WHERE a.strStreetNumber = b.strStreetNumber ORDER BY a.strPostalCode /CFQUERY cfset StreetName_array = arraynew(2) CFSET i =1 CFLOOP query=PostalCode_list cfset StreetName_array[i][1] = #trim(strPostalCode)# cfset StreetName_array[i][2] = #trim(strStreetName)# cfset StreetName_array[i][3] = #trim(strBlockNumber)# CFSET i = i + 1 /CFLOOP CFWDDX INPUT=#StreetName_array# OUTPUT=MyWDDXPacket ACTION=CFML2WDDX CFWDDX INPUT=#MyWDDXPacket# OUTPUT=DynamicJSCode ACTION=WDDX2JS TOPLEVELVARIABLE=StreetName_array scriptcfoutput#DynamicJSCode#/cfoutput/script table width=100% border=0 cellspan=0 tr td width=5%BLK/HSE NO./td td width=25%cfinput type=text name=strBlockNumber size=5 maxlength=5 message=Please enter your Block / House Number. required=Yes onerror=setFocus value=#session.prospect.strBlockNumber#/td td width=5%FLR./td td width=25%cfinput type=text name=strFloorNumber size=5 maxlength=5 message=Please enter your Floor Number. required=No value=#session.prospect.strFloorNumber#/td td width=5%UNIT/td td width=25%cfinput type=text name=strUnitNumber size=5 maxlength=5 message=Please enter your Unit Number. required=No value=#session.prospect.strUnitNumber#/td td width=5%nbsp;/td td width=5%nbsp;/td /tr tr tdST/td td colspan =3cfinput type=text name=strStreetName size=50 maxlength=50 message=Please enter your Street Name. required=Yes onerror=setFocus value=#session.prospect.strStreetName#/td tdBLDG/td td colspan =3cfinput type=text name=strBuildingName size=50 maxlength=50 message=Please enter your Building Name. required=No value=#session.prospect.strBuildingName#/td /tr tr tdPD/td tdcfSELECT name=strPostalName display=strPostalCode value=strPostalCode query=postalCode_list size=1 message=Please choose your Postal Code. required=Yes onerror=setFocus Selected=#session.prospect.strPostalName# onChange=display_Street(this.options[this.selectedIndex].value, StreetName_array);/CFSELECT/td tdTYPE/td tdcfselect name=strAddressType message=Please enter your Housing Type. required=Yes onerror=setFocus Selected=#session.prospect.strAddressType# size=1 option value=A cfif #session.prospect.strAddressType# eq 'A'SELECTED/cfifA/option option value=B cfif #session.prospect.strAddressType# eq 'B'SELECTED/cfifB/option /cfselect/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td /tr /table __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists