Skip to main content
Inspiring
March 20, 2009
Question

ajax using checkboxes

  • March 20, 2009
  • 1 reply
  • 343 views
i have a ajax form that has 2 dropdowns one for company and the other is fullname linked to the company... but i have a problem in that when it pulls their specific member record they can have several positions in the member category such as president and co founder... which are listed in a seperate table that has the (memberid), (categoryid) and (categoryname)... when i make an ajax input it enters in only one of the several... but i want to have it loop and grab all of the categories that are linked to that member as well as display it next to a checkbox so when they check the box, the javascript i have will delete it from the category... i hope that made sence... here is my cfc code
This topic has been closed for replies.

1 reply

LithcauseAuthor
Inspiring
March 20, 2009
<cffunction name="getmemberinfo" access="remote" returnType="struct">
<cfargument name="cid" type="numeric" required="true">
<cfset var memcat="">
<cfset var c = "">
<cfset var f = structNew()>
<cftry>
<cfquery name="memcat" datasource="#applicationdsn#">
SELECT members.memberrecordid, CategorData.CatdataId, Category.CatId, Category.Category, Contacts.cid
FROM CategorData FULL OUTER JOIN
Category ON CategorData.CatId = Category.CatId FULL OUTER JOIN
members ON CategorData.memberrecordid = members.memberrecordid FULL OUTER JOIN
Contacts ON members.cid = Contacts.cid
WHERE Category.CatId= <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.cid#">
</cfquery>
<!--- --->
<cfloop list="#memcat.columnlist#" index="c">
<cfset f = data[1]>
</cfloop>
<cfcatch type="any">
<cfset returnStruct.success = false />
<cfset returnStruct.message = cfcatch.message />
</cfcatch>
</cftry>
<cfreturn f>
</cffunction>