I need an example of the following:
I have cfselect on the form that has display set to
CompanyName and value set to CompanyID.
There is also cfinput for CompanyAddress on the same form.
When user selects a list item in cfselect, I need to take
CompanyID, lookup CompanyAddress in the database, and populate
cfinput with CompanyAddress.
There are a few of ways you can accomplish this - all with
differing levels of security and complexity.
1) You can include the company addresses is your Query, then
#companyID#_address) for each address. Then when a user selects the
value of CompanyAddress:
document.form.CompanyAddress.value = Eval(this.value +
There are obvious security problems with this approach as
every company's address will be listed on in your HTML code
2) You can use AJAX to retrieve the information "behind the
scenes". This is one of those situations that ajax is perfect for -
the only problem is the complexity of the operation if you are not
familiar with the methodology.
3) If you are familiar with using WDDX (a generic XML
WDDX package using <cfwddx>. Personally, I don't have much
could use the companyID as a key to retrieve your company address