I've been working on this for a while and I've created a test page
before I move this over to my full form.
 
How can I create a loop that will allow my insert to work?
 
This is what I have:
 
 <cfif IsDefined('form.action')> 
  <cfquery name="addorg" datasource="#DSN#">
  INSERT INTO org_admin (users_id, org_id)
  VALUES (#form.users_id#,'#form.org_id#')
  </cfquery>
 </cfif>
 
 <!--- GENERIC QUERIES AND VARIABLE SETTING --->
 
 <cfquery name="list" datasource="#DSN#">
 SELECT  * FROM  organizations ORDER BY org_abbr
 </cfquery>
 
 <!--- END GENERIC QUERIES AND VARIABLE SETTING --->
 
 <cfform action="" method="post">
 <table border="0" cellpadding="0" cellspacing="0">
 <tr>
    <td colspan="3">
    <table cellpadding="2" cellspacing="0" width="100%">
    <tr>
        <td>Please select the Lung Associations that this user is
responsible for:</td>
    </tr>
    <tr>
        <td>
        <CF_Columns Cols="3" Records="#list.RecordCount#">
   
        <table border="0" cellpadding="2" cellspacing="0" width="100%">
        <tr>
        <!--- Loop through the number of columns desired. --->
        <cfloop index="LoopCount" from="1" to="3">
        <!--- Access the start and end variables created by the custom
tag. --->
        <cfset #start# = ("start" & #LoopCount#)>
        <cfset #end# = ("end" & #LoopCount#)>
            <td valign="top">
            <cfoutput query="list" startrow="#Evaluate(start)#"
maxrows="#Evaluate(end)#">
            <cfinput type="checkbox" value="1" name="org" />
#org_abbr#<br>
                <input type="hidden" name="org_id" value="#list.id#">
            </cfoutput>
      </td>
     </cfloop>
     </tr>
     </table>
     </td>
    </tr>
    </table>
    <br />
    </td>
 </tr>
 <tr>
  <td width="25%">&nbsp;</td>
  <td colspan="3">
  <cfoutput><input type="hidden" name="users_id"
value="#url.id#"></cfoutput>
  <input type="hidden" name="action" value="add">
  <input type="submit" name="Submit">
  </td>
 </tr>
 </table>
 </cfform>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to