[thelist] Listing all form elements with VBscript

aardvark roselli at earthlink.net
Thu Jun 20 23:31:01 CDT 2002


> From: Joel Canfield <joel at spinhead.com>
>
> I'm creating a simple checklist which needs to be tracked in a db.
> There will be anywhere from ten to thirty checkboxes, all
> automatically dynamically named. All I need to store and retrieve is
> the checked state of each checkbox. Or actually, a simple list of the
> id of all checkboxes checked.

will every checkbox be a unique form item?  so you won't have
multiple checkboxen with the same name?

or will it be this?
<input type="checkbox" name="foo" id="foo_1" value="1">
<input type="checkbox" name="foo" id="foo_2" value="2">
<input type="checkbox" name="foo" id="foo_3" value="3">

if they're all the same name, they'll be a comma-separated list of
values when submitted...

> F'rinstance, if I check boxes a1, s3, e1, e3, and e14, next time
> anyone looks at the form those boxes still need to be check. But if
> they also check a2 and s2, but uncheck e3, that should be updated.

if it's a comma-separate list, like above, you could just use an
instr() check -- assuming each one will be unique enough (so a check
for "e1" would pass if "e14" was in it, unless you went by "e1,")...

> My thought was to just string all the checked ids together separated
> by pipes or whatever, then when the page is retrieved, parse it and
> write a checked value for any id listed.
[...]

to me, the answer is based on the names of the checkboxen... all the
same field or not, that is...

--
Read the evolt.org case study
Usability: The Site Speaks for Itself
http://amazon.com/exec/obidos/ASIN/1904151035/evoltorg
ISBN: 1904151035





More information about the thelist mailing list