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:
[protect admin] (1997)
Re:Searching for ALL / empty form field (1997)
Runtime version ... (2003)
searchable list archive (1997)
emailer (1997)
Sendmail (2000)
how to check for no value while using [URL] to prevent cr (1999)
Two submit buttons ? (1997)
remove line item (2000)
WC2b15 File Corruption (1997)
Affiliate Program code (2000)
Just Testing (1997)
[carts] and databases (1997)
Cart Numbers (1997)
WebCat B13 Mac CGI -- Frames question (1997)
Showif, Hideif reverse logic ? (1997)
WebCat2 beta 11 - new prefs ... (1997)
[shell] (2002)
Re:Emailer and encryption (1997)
PCS Frames (1997)