Greg

Try this



///////////// Form ////////////////
<form action="Products.cfm" method="POST">
<input type="Hidden" name="ProductIDs"
value="<cfoutput>#ValueList(special.ProductID)#</cfoutput>">
<input type="Hidden" name="updateprice" value="updateprice">
<table cellspacing="2" cellpadding="2" border="0">
        <tr>
                <td>Product Part No Name</td>
                <td>Featured</td>
                <td>Special</td>
                <td>Hide</td>
                <td>Price</td>
        </tr>
        <cfoutput query="special">
        <input type="Hidden" name="productid" value="#productid#">
        <tr bgcolor="#IIf(CurrentRow Mod 2, DE('#prefs.rowcolor1#'),
DE('#prefs.rowcolor2#'))#">
                <td>#productpartno# - #productname#</td>
                <td><input type="Checkbox" name="Featured_#productid#" value="1" <cfif
"#Featured#" is "yes">checked</cfif>></td>
                <td><input type="Checkbox" name="special_#productid#" value="1" <cfif
"#special#" is "yes">checked</cfif>></td>
                <td><input type="Checkbox" name="hiddenprod_#productid#" value="1" 
<cfif
"#hiddenprod#" is "yes">checked</cfif>></td>
                <td><input type="Text" name="price_#productid#" value="#unitprice#"
size="5" maxlength="10"></td>
        </tr>
        </cfoutput>
</table>
<input type="Submit" name="save" value="save changes">
</form>


////////////////// update script //////////////////////////////
<cfif isdefined("form.updateprice")>
        <cfloop list="#Form.ProductIDs#" index="p">
                <CFQUERY DATASOURCE="#prefs.dsn#">
                        UPDATE  products
                        SET             unitprice='#Form["price_#p#"]#'
                                        <cfif isDefined("Form.Featured_#p#")>, 1</cfif>
                                        <cfif isDefined("Form.special_#p#")>, 1</cfif>
                                        <cfif isDefined("Form.hiddenprod_#p#")>, 
1</cfif>
                        WHERE   productid = #p#
                </CFQUERY>
        </cfloop>
</cfif>



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to