Re: Remove Multiple Line Items
This WebDNA talk-list message is from 2005
It keeps the original formatting.
numero = 62832
interpreted = N
texte = You have to keep a counter going to adjust for the changing line item value. Decrement it each time something's deleted. Here's my exact code:[showif [trig]=Recalculate][math show=f]adjustby=0[/math][formvariables name=qty_&exact=F][math show=f]updateitemnumber=[getchars start=5][name][/getchars]+adjustby[/math][showif [value]=0][removelineitem file=ShoppingCarts/[cart]&index=[updateitemnumber]][math show=f]adjustby=adjustby-1[/math][/showif][hideif [value]=0][setlineitem file=ShoppingCarts/[cart]&db=[db]&index=[updateitemnumber]]quantity=[value][/setlineitem][/hideif][/formvariables][/showif]Terry>Hi>>I am trying to remove multiple line items from a cart in one form>>If I have 10 items in a cart and want to remove 4 at once there is a >problem in that once the first item is removed the remaining items >change their [index] to take up the now removed row.>>Therefore if I wanted to remove items 1, 4, 5, 10>When number one is removed Item 4 becomes 3, 5 becomes 4, 9 becomes >10. When 4 is removed it removes the original 5 which is now number >4, the original 10 becomes 8.>>When 5 is removed the original 7 is removed - BAD and the original >10 becomes 7, now there is no number 10 to remove.>>Any ideas ?>>Stuart Tremain>idfk web developments, sydney, australia-- Terry Wilson | terry@terryfic.com | http://terryfic.comhttp://WhosComing.com - a simplified, affordable online reservation systemhttp://TightPods.com -- stylish protection for your laptop--------------------------------------------------------------------------Attitude is the only difference between ordeal and adventure.-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
You have to keep a counter going to adjust for the changing line item value. Decrement it each time something's deleted. Here's my exact code:[showif [trig]=Recalculate][math show=f]adjustby=0[/math][formvariables name=qty_&exact=F][math show=f]updateitemnumber=[getchars start=5][name][/getchars]+adjustby[/math][showif [value]=0][removelineitem file=ShoppingCarts/[cart]&index=[updateitemnumber]][math show=f]adjustby=adjustby-1[/math][/showif][hideif [value]=0][setlineitem file=ShoppingCarts/[cart]&db=[db]&index=[updateitemnumber]]quantity=[value][/setlineitem][/hideif][/formvariables][/showif]Terry>Hi>>I am trying to remove multiple line items from a cart in one form>>If I have 10 items in a cart and want to remove 4 at once there is a >problem in that once the first item is removed the remaining items >change their [index] to take up the now removed row.>>Therefore if I wanted to remove items 1, 4, 5, 10>When number one is removed Item 4 becomes 3, 5 becomes 4, 9 becomes >10. When 4 is removed it removes the original 5 which is now number >4, the original 10 becomes 8.>>When 5 is removed the original 7 is removed - BAD and the original >10 becomes 7, now there is no number 10 to remove.>>Any ideas ?>>Stuart Tremain>idfk web developments, sydney, australia-- Terry Wilson | terry@terryfic.com | http://terryfic.comhttp://WhosComing.com - a simplified, affordable online reservation systemhttp://TightPods.com -- stylish protection for your laptop--------------------------------------------------------------------------Attitude is the only difference between ordeal and adventure.-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Terry Wilson
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Separate SSL Server (1997)
[OT] Linux Vs. OSX (leopard) server (2007)
Bill To - Ship To Information display (1997)
Protect (1997)
Removing [showif] makes a big difference in speed (1997)
Where is Orders.db appended? (2000)
separate by mont (search) (2002)
Force a search at the default.tmpl page? (1997)
[WebDNA] Yosemite (2014)
New public beta available (1997)
Sendmail truncation in Eudora Clients (1998)
Leap Day Triggers? -confirmation- (2000)
Suggestions (1998)
Error:Too many nested [xxx] contexts (1997)
WebCatalog 4.0.1 has been released! (2000)
WebCat2 - Getting to the browser's username/password data (1997)
# of real domains on 1 web server (1997)
SIMS setup (1998)
[WebDNA] [BULK] Securing WebCatalog login (2017)
[WebDNA] [listwords] and [index] (2009)