Re: Checkboxes
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 19274
interpreted = N
texte = At 9:55 Uhr 03.08.1998, Charles Kefauver wrote:>If anyone else has a better way to use checkboxes, please let us know...I do not know what exactly you want to do, but if you need ALL boxes on theresponse page, you could make a [loop] there instead using [formvariables].That allows more control. Of course, you need numbered variables. Maybe youcan adapt this code snippets to your needs:---input.tpl---
---countboxes is the number of boxes you have, set it's value to [numfound]and write the names of the checkboxes as cb.[index] to get numbered. Thefield values can be anything.---ouput.tpl---[math show=f]cnt=0[/math][loop start=1&end=[countboxes]] [math show=f]cnt=cnt+1[/math] [showif [interpret][cb.[math]cnt[/math]][/interpret]^cb] cb.[math]cnt[/math]=off [/showif] [hideif [interpret][cb.[math]cnt[/math]][/interpret]^cb] cb.[math]cnt[/math]=[interpret][cb.[math]cnt[/math]][/interpret][/hideif]
[/loop]---In plain speech:#set a counter to 0.#[countboxes] comes from input.tpl and is the length of the loop.#at each run increment the counter to construct the fieldnames.#if [cb.x] containes cb, show cb.x=off#if not, show the value of the field [cb.x]In the above example, when you check just the second checkbox, you get thisresponse:cb.1=offcb.2=222cb.3=offHope this helps,Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++43-1-8777454 fax ++43-1-8777454-21
Associated Messages, from the most recent to the oldest:
At 9:55 Uhr 03.08.1998, Charles Kefauver wrote:>If anyone else has a better way to use checkboxes, please let us know...I do not know what exactly you want to do, but if you need ALL boxes on theresponse page, you could make a
[loop] there instead using
[formvariables].That allows more control. Of course, you need numbered variables. Maybe youcan adapt this code snippets to your needs:---input.tpl---
---countboxes is the number of boxes you have, set it's value to [numfound]and write the names of the checkboxes as cb.[index] to get numbered. Thefield values can be anything.---ouput.tpl---[math show=f]cnt=0[/math][loop start=1&end=[countboxes]] [math show=f]cnt=cnt+1[/math] [showif
[interpret][cb.
[math]cnt[/math]][/interpret]^cb] cb.
[math]cnt[/math]=off [/showif] [hideif
[interpret][cb.
[math]cnt[/math]][/interpret]^cb] cb.
[math]cnt[/math]=
[interpret][cb.
[math]cnt[/math]][/interpret][/hideif]
[/loop]---In plain speech:#set a counter to 0.#[countboxes] comes from input.tpl and is the length of the loop.#at each run increment the counter to construct the fieldnames.#if [cb.x] containes cb, show cb.x=off#if not, show the value of the field [cb.x]In the above example, when you check just the second checkbox, you get thisresponse:cb.1=offcb.2=222cb.3=offHope this helps,Peter__________________________________________Peter Ostry - po@ostry.com - www.ostry.comOstry & Partner - Ostry Internet SolutionsAuhofstrasse 29 A-1130 Vienna Austriafon ++43-1-8777454 fax ++43-1-8777454-21
Peter Ostry
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:
2.1 pricing? (1998)
Setting up shop (1997)
Resume Catalog ? (1997)
Files not moved to EmailCompleted (2002)
RE: 2nd WebCatalog2 Feature Request (1996)
[Fwd: F3 database munching] (1997)
using showpage and showcart commands (1996)
Showif, Hideif reverse logic ? (1997)
Random (2000)
showif with math? (2000)
Field name-subcategory (1997)
Late on Friday.... brain fried (2002)
name-value pairs (2006)
Re(6): Small Bug: ErrorLog.txt/[FORMVARIABLES]/[ORDERFILE] (1998)
WebCat2b13 Command Reference Doc error (1997)
YACBQ.....(Yet another checkbox question) (2000)
Server IP address-thanks (2004)
Trouble with Netscape (1998)
WCS Newbie question (1997)
A multi-processor savvy WebCatalog? (1997)