Don't know if the following code will help -- but here it is anyway -- it 
loops over the contents of a multi-select picklist stored in mCO_LIST, 
extracts the division number from the back end of the picklist display and 
inserts the selections into a table while also displaying what was picked 
on the picklist to the screen -- not for confirmation in this scenario, but 
it could have been done that way with two loops.

<CFOUTPUT>

<table width="670" border="0" cellspacing="1" cellpadding="5" 
ALIGN="CENTER">
<tr>
<td>
  <font face="Arial" COLOR="Browm" SIZE="2">
  <B>User now has access to the following Div/Subs:<BR>
    <cfloop index="NAME" list="#FORM.mCO_LST#" delimiters=",">

      <CFSET mDIV_NUM = #mid(right(trim(Evaluate("NAME")),5),2,3)# * 1>

      &nbsp;&nbsp;&nbsp;>&nbsp;#NAME#<BR>

      <CFQUERY NAME="U_RIGHT_INS" DATASOURCE="COLAB2">
        INSERT INTO
           U_RIGHTS (USER_ID        ,
                     DIV_NUM        ,
                     CAN_EDIT     )
             VALUES ('#mUSER_ID#'   ,
                      #mDIV_NUM#    ,
                      'N'         )
      </CFQUERY>

    </cfloop>
    </B>
  </TD>
  <TR>
  </TABLE>
</CFOUTPUT>

     ^
    / \__
   (    @\___
  /          O
 /    (_____/
/_____/
Whoof...
410-757-3487

-----Original Message-----
From:   Shannon Carr [SMTP:[EMAIL PROTECTED]]
Sent:   Monday, March 05, 2001 4:17 PM
To:     CF-Talk
Subject:        Loops and Update queries

I am trying to update a table using values that were input on a form using
<cfloop> .

On the input form I am using a loop query to output the Item_Number,
Item_Description and Quantity fields. The user can update the quantity.

On the second page I would like to display inside a table, the variables 
for
confirmation, then update the table once confirmed. I am having a problem
parsing the Item_Number and Quantity fields together on the display and
table update. The table being updated does not have a unique ID.


INPUT PAGE:

<cfloop query="itemsbydrawing">
     <tr bgcolor="#IIf(CurrentRow Mod 2, DE('ffffff'), 
DE('#tr_color2#'))#">
      <td nowrap>&nbsp;#item_number#</td>
      <td nowrap>&nbsp;#Item_description#</td>
      <td nowrap align="center">
      <input type="Text" name="Quantity" value="#Quantity#" size="4"
maxlength="6"
       onFocus="window.status='Quantity'; return true"></td>
      <td width="100%">&nbsp;#CurrentRow#</td>
      <!--- <td align="center" nowrap>
      <cfinput type="CheckBox" name="DeleteItem" value="yes"></td> --->

     </tr>
     <input type="hidden" name="ITEM_NUMBER" value="#ITEM_NUMBER#">
     <input type="hidden" name="ITEM_DESCRIPTION"
value="#ITEM_DESCRIPTION#">
     </cfloop>


Any help would be appreciated.

Thanks,
Shannon
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to