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:

Error Log.db --however (1997) RE: [WebDNA] anyone know how to enable URLs in plain text to links? (2009) Need help... (1997) More news on 5.0 (2003) New WebCatalog Version !!! (1997) Further tests with the infamous shipCost (1997) Updating Prices in DB (working) (1999) Strange Search Results (2004) using showpage and showcart commands (1996) How do I handle extra spaces? (2002) Re:Navigator 4.01 (1997) 2.0Beta Command Ref (can't find this instruction) (1997) WebDNA Payment Alternatives (2003) PCS Emailer's role ? (1997) WebCat Problem? (1999) [ModDate] & [ModTime] ? (1997) Tab Charactor (1997) upgrade? (1997) Webstar 1.3.1 PPC (1997) Spell Check (2003)