1 Reply Latest reply on Mar 20, 2009 10:20 AM by Lithcause

    ajax using checkboxes

      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
        • 1. Re: ajax using checkboxes
          Lithcause Level 1
          <cffunction name="getmemberinfo" access="remote" returnType="struct">
          <cfargument name="cid" type="numeric" required="true">
          <cfset var memcat="">
          <cfset var c = "">
          <cfset var f = structNew()>
          <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#">
          <!--- --->
          <cfloop list="#memcat.columnlist#" index="c">
          <cfset f[c] = data[c][1]>
          <cfcatch type="any">
          <cfset returnStruct.success = false />
          <cfset returnStruct.message = cfcatch.message />
          <cfreturn f>