Nice one Steve!

I hate the email ...... delay 

--- much better solution too! ;-)

-----Original Message-----
From: Steve Onnis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 15, 2004 3:10 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: NEW batch style update request


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/

---
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