469,306 Members | 1,618 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

repost, sort of--dynamic checkboxes

Hate to post this in a separate post, but felt that the last thread was too
far down to get noticed. It is called dynamic checkboxes, and it contained
some good advice for me, but it led to another question, and I wanted to go
ahead and post my question here in hopes of getting an answer.

The advice given to me about having a number of checkboxes which are put
onto the page from the database, was to name them all the same thing, and
then, on the next page, do a request.form of that form field name, and it
would return a string.

This worked very well, and I confirmed that if I checked boxes 3, 5, and 9,
I would get (3,5,9) returned to me. However, I am not sure how I can get
these values stored into my database. In my case, I'll want to store the
person's ID, called PersonalID, which I will get another way. Let's assume I
have that value, and it's '1'. I want to insert 1,3 then 1,5, then 1,9 into
the table, into the fields PersonalID and PeopleID, respectively. That's 3
rows in that table, and it is dynamic, so a user could enter 0 to many rows
into this table.

Can someone help me get this syntax? There was a suggestion in the last post
offered to me, but I didn't get it at all.


Jul 19 '05 #1
1 1500
something like....

dim sChecks, arrChecks, personId, x, sSQL

personId=[whereever you get it from]
sChecks=request.form("checkbox_name") & ""

if len(sChecks)>0 then

arrChecks=split(sChecks,",")

for x=lbound(arrChecks) to ubound(arrChecks)

sSQL="insert into ....." 'insert SQL using arrChecks(x) and
personId
oConn.execute sSQL...
next
end if

tim

"middletree" <mi********@htomail.com> wrote in message
news:OO**************@TK2MSFTNGP12.phx.gbl...
Hate to post this in a separate post, but felt that the last thread was too far down to get noticed. It is called dynamic checkboxes, and it contained some good advice for me, but it led to another question, and I wanted to go ahead and post my question here in hopes of getting an answer.

The advice given to me about having a number of checkboxes which are put
onto the page from the database, was to name them all the same thing, and
then, on the next page, do a request.form of that form field name, and it
would return a string.

This worked very well, and I confirmed that if I checked boxes 3, 5, and 9, I would get (3,5,9) returned to me. However, I am not sure how I can get
these values stored into my database. In my case, I'll want to store the
person's ID, called PersonalID, which I will get another way. Let's assume I have that value, and it's '1'. I want to insert 1,3 then 1,5, then 1,9 into the table, into the fields PersonalID and PeopleID, respectively. That's 3 rows in that table, and it is dynamic, so a user could enter 0 to many rows into this table.

Can someone help me get this syntax? There was a suggestion in the last post offered to me, but I didn't get it at all.



Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Kate | last post: by
2 posts views Thread by NotYetaNurd | last post: by
48 posts views Thread by Alex Chudnovsky | last post: by
reply views Thread by apattin | last post: by
8 posts views Thread by PeteOlcott | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.