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:
Help Encrypt/Decrypt eMail (2003)
RequiredFields template (1997)
Search for dates greater than [date] (1997)
[WriteFile] problems (1997)
'does not contain' operator needed ... (1997)
default value from Lookup (was Grant, please help me) (1997)
WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997)
First postarg not taking in $Commands (1997)
Cant open pages generated by Webcat (2004)
Help! WebCat2 bug (1997)
BUG in WebCatalog 4.0.1 on Mac OSX (2000)
mass mailing (1998)
WebCat and image maps (1997)
WebCat2 as a chat server? (1997)
Error Messges (1997)
Mac 2.1b2 speed (1997)
Unexpected error (1997)
test message 4 (2000)
Roundup function? (1997)
Formating found categories (1997)