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:
PDF mailing labels (2000)
affiliate marketing program (1998)
Errata: WCS Newbie question (1997)
Problems problems problems (1997)
emailer error -108 (1997)
state? (2004)
emailer settings and control questions (1997)
Bug or syntax error on my part? (1997)
Credit Card Number checking (1997)
SSL Certs (2003)
unclear on a simple [cart] ? (1998)
domain in cookie (2006)
New iMac, now ... how do I make webdna serve .html files? (2005)
Alternating colors (1997)
Online reference (1997)
WCS Newbie question (1997)
PCS Frames (1997)
Looking for WebCatalog Programmer in Silicon Valley (1998)
Multiple cart additions (1997)
Shipping still a problem!! (1998)