Hi,
I'm trying to use an auto-fill in my form for addresses/places based on zip-code. I've found an example script which does what I need (with javascript and PHP) but I need this to work with CF. The example I've found retrieves the address and place from an external website, based on a given zip-code.
Basically the script works like this:
In a form I have a field ("pc") for the zip_code which calls a Javascript function by "onChange="getAddress(this.value)".
This "getaddress"-function is calling an php-file (getpc.php) which get the content of an url in which the 'address' and 'place' are being sort out. Then the fields 'address' and 'place' in the form are being updated with this data.
To make it short:
form->calls javascript based on "onChange"-> calls getpc.php-> gets data from other site -> fields in form are automatically being filled
I've tested this with just a plain form in php and it works. To make it work with CF I've included the Javascript-code in the Form-code-Javscript. All I need now is to put the 'getpc.php' file somewhere which is being called by the javascript.
Where to put this file, or if even better (?), where can I put this php-code?
Thanks,
Robin
I'm trying to use an auto-fill in my form for addresses/places based on zip-code. I've found an example script which does what I need (with javascript and PHP) but I need this to work with CF. The example I've found retrieves the address and place from an external website, based on a given zip-code.
Basically the script works like this:
In a form I have a field ("pc") for the zip_code which calls a Javascript function by "onChange="getAddress(this.value)".
This "getaddress"-function is calling an php-file (getpc.php) which get the content of an url in which the 'address' and 'place' are being sort out. Then the fields 'address' and 'place' in the form are being updated with this data.
To make it short:
form->calls javascript based on "onChange"-> calls getpc.php-> gets data from other site -> fields in form are automatically being filled
I've tested this with just a plain form in php and it works. To make it work with CF I've included the Javascript-code in the Form-code-Javscript. All I need now is to put the 'getpc.php' file somewhere which is being called by the javascript.
Where to put this file, or if even better (?), where can I put this php-code?
Thanks,
Robin