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:
problems with WebCat-Plugin (1997)
sendmail and accented characters (1998)
Re:Emailer and encryption (1997)
E-Mail Preferences in Admin Folder (1997)
searching within same page (2000)
[lookup] vs. [search] (1998)
WebCat and image maps (1997)
emailer stuck (1997)
Searchable WebCat (etc.) Docs ? (1997)
2.0Beta Command Ref (can't find this instruction) (1997)
[OT] Discussion forum, last visit, Cookie, ... (2003)
Hosting Services (1999)
Hard carriage convertion? (1998)
Where's Cart Created ? (1997)
[WebDNA] autonumber duplication, time stamp issue & locking up (2010)
Custom formulas.db (1998)
PROTECT tag suggestion (2004)
Clickable Maps (1996)
bye bye tax rate (1998)
(slightly off) using menu and [search] (1998)