Re: Remove Multiple Line Items

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 62834
interpreted = N
texte = Thanks Terry, I'll give it a go :) Stuart Tremain idfk web developments, sydney, australia On 23 Aug 2005, at 11:26 PM, Terry Wilson wrote: > 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.com > http://WhosComing.com - a simplified, affordable online reservation > system > http://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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- 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:

    
  1. Re: Remove Multiple Line Items ( Stuart Tremain 2005)
  2. Re: Remove Multiple Line Items ( Brian Fries 2005)
  3. Re: Remove Multiple Line Items ( Stuart Tremain 2005)
  4. Re: Remove Multiple Line Items ( Stuart Tremain 2005)
  5. Re: Remove Multiple Line Items ( Stuart Tremain 2005)
  6. Re: Remove Multiple Line Items ( Terry Wilson 2005)
  7. Re: Remove Multiple Line Items ( Kenneth Grome 2005)
  8. Remove Multiple Line Items ( Stuart Tremain 2005)
Thanks Terry, I'll give it a go :) Stuart Tremain idfk web developments, sydney, australia On 23 Aug 2005, at 11:26 PM, Terry Wilson wrote: > 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.com > http://WhosComing.com - a simplified, affordable online reservation > system > http://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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- 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/ Stuart Tremain

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:

Fun with Dates - finally resolved but.... (1997) [WebDNA] PayPal Instant Payment Notification Guide (2009) SiteGaurd file Cache vs webcatalog cache (1997) Summing fields (1997) Alternating colors (1997) [Announce]: Web server security and password protection (1997) Configuring E-mail (1997) WebCat2 - Getting to the browser's username/password data (1997) Major OT shopping cart test request. (2002) problems with 2 tags (1997) [REPLACE] inside [FOUNDITEMS] (1998) Mozilla/4. and Browser Info.txt (1997) How to implement 'email to a friend' feature? (2002) Problems appending to database (1997) Online Docs? (1997) Virtual hosting and webcatNT (1997) Closing Databases (1998) Re:2nd WebCatalog2 Feature Request (1996) RE: type 2 errors with ssl server (1997) WebCatalog Install Problem (2005)