[thelist] Listing all form elements with VBscript

Joel Canfield joel at spinhead.com
Fri Jun 21 10:53:02 CDT 2002


> > to me, the answer is based on the names of the
> checkboxen... all the
> > same field or not, that is...
>
> Ditto. If you name all the checkbox fields the same thing,
> then give them a unique value (e1, s12, etc), and you do a
> request.form("foo") after the form is submitted, you'll see a
> comma delineated list of all the checked values (e.g. "e1,
> e2, d4, e42")

Tenks, Ken and aaaaaaaaaaaaaaaaaard - I was missing this concept: name all
the boxes the same, but differentiate by giving them a value. And of course,
give 'em an id for the <label> tags.

What I've got now: each box is either statically named (a few) or
dynamically named from the db. On the response page, I'm just taking the
employee ID and Request.Form("ckbx") and shoving it into the db. When the
original page reloads, I grab the ckbx string from the db, then for each
checkbox, use InStr to see if it's id exists in ckbx. If so, write 'checked'
with the checkbox tag.

Now that I'm less groggy, I'm going to smoosh the response page into the
head of the original page, and just make it cyclic. I love single page web
apps.

Thanks again. Since I finished this up, I get to go into the office two
hours late today.

joel



More information about the thelist mailing list