I'm close on this one.
I am calling a CFC to query some data:
$.ajax({
dataType: 'json',
data: {
customer_name: $('##customer_name').val()
},
url: "cfcs/customers_lookup.cfc?method=getAddress&returnformat=query",
beforeSend: function(){
$('.loader').show();
},
complete: function(){
$('.loader').hide(3000);
console.log(JSON.stringify(data));
},
success: function(response) {
$.each(response.DATA, function(i, row){
// get value in first column ie "description"
var address = row[0];
// append new option to list
$("##customer_address").append(address);
})
}
});
In my CFC, I query the database as follows:
<cffunction name="getAddress" access="remote" returnType="query">
<cfargument name="customer_name" type="any" required="true">
<!--- localize function variables --->
<cfset var addressDetail = "">
<cfoutput>
<cfquery name="addressDetail" datasource="#datasource#">
SELECT address1, address2
FROM customer_table
<!--- adjust cfsqltype if needed --->
WHERE company_name = <cfqueryparam value="#ARGUMENTS.customer_name#" cfsqltype="cf_sql_varchar">
</cfquery>
</cfoutput>
<cfreturn addressDetail>
</cffunction>
The problem I'm having is that my output in my HTML form field looks like this: Column1Column2
How can I output that to have a space between each output?
Thanks!