Looping a variable name with [index]

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 24104
interpreted = N
texte = Hey all, Can't figure out why this doesn't work... I've got a form with field names q1 through q11. On the following page I want to verify whether one or more of the fields have been filled in with this code:[math show=f]didQ=0[/math] [loop start=1&end=11][showif [q[index]]!][math show=f]didQ=didQ+1[/math][/showif][/loop][showif [didQ]>0] You filled in one or more fields [/showif] [showif [didQ]=0] You didn't fill in even one field [/showif]This doesn't work. If I set the math to show=t, I get 1234567891011 on the page, even if all the fields from the form are empty. Is there something wrong with my implementation of the loop or is it not possible to use the index value as part of a variable name construct?Thanks, Mike Davis Associated Messages, from the most recent to the oldest:

    
  1. Re: Looping a variable name with [index] (Will Starck 1999)
  2. Looping a variable name with [index] (Mike_Davis 1999)
Hey all, Can't figure out why this doesn't work... I've got a form with field names q1 through q11. On the following page I want to verify whether one or more of the fields have been filled in with this code:[math show=f]didQ=0[/math] [loop start=1&end=11][showif [q[index]]!][math show=f]didQ=didQ+1[/math][/showif][/loop][showif [didQ]>0] You filled in one or more fields [/showif] [showif [didQ]=0] You didn't fill in even one field [/showif]This doesn't work. If I set the math to show=t, I get 1234567891011 on the page, even if all the fields from the form are empty. Is there something wrong with my implementation of the loop or is it not possible to use the index value as part of a variable name construct?Thanks, Mike Davis Mike_Davis

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:

Sku numbers (1997) RE: [isfolder] and [filename] (1997) WebCat & cookies (1998) Nesting format tags (1997) Summing fields (1997) show all problem (1997) can WC render sites out? (1997) Click-through/Referral tracking solution needed (2000) SET (1998) problems with 2 tags (1997) profiles (1999) How does the Globals folder work? (2000) WebCat/Flash/authentication/protection (2000) Summary search -- speed (1997) comparison to Lasso 6 or 7 (2004) Can this be done? (1997) WebTen and WebCat (1997) Banners (1997) Deadlocked Errors (1999) Last Record not recognized? (1999)