Populating cfinputs in a form
I'm using the following function to retrieve two fields from the item table. At
the end I am returning qty.qtystock and the data from this field is correctly
put into the respective cfinput.
I would like to add another cfinput (and more) to populate the field saleprice
that is being queried but since I could not find a way to return this value I
would like to ask whether this is possible?
The function:
<cffunction name="getQty" access="remote" returntype="any">
<cfargument name="article_no" type="string" required="true">
<!--- Define variables --->
<cfset var data="">
<!--- Get data --->
<cfquery name="qty" datasource="#THIS.dsn#">
SELECT qtystock, saleprice
FROM ITEM
WHERE sku = SUBSTRING_INDEX('#ARGUMENTS.article_no#', ' ', 1)
</cfquery>
<!--- And return it --->
<cfreturn qty.qtystock>
</cffunction>
The Form:
<cfselect name="article_no" bind="cfc:getDesc.lookupDescription()"
display="description" value="description" bindonload="true"></cfselect>
<cfinput type="text" size="10" name="instock"
bind="cfc:getDesc.getQty({article_no})">
|