repost, sort of--dynamic checkboxes

Discussion in 'ASP General' started by middletree, Dec 10, 2003.

  1. middletree

    middletree Guest

    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.
     
    middletree, Dec 10, 2003
    #1
    1. Advertising

  2. middletree

    Tim Williams Guest

    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" <> wrote in message
    news:...
    > 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.
    >
    >
    >
    >
    >
    >
    >
    >
     
    Tim Williams, Dec 10, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott
    Replies:
    2
    Views:
    402
    Scott
    Aug 9, 2007
  2. Pete Hurst

    Dynamic Data woes [repost]

    Pete Hurst, Apr 17, 2009, in forum: ASP .Net
    Replies:
    5
    Views:
    473
    Mr. Arnold
    Apr 20, 2009
  3. Navin
    Replies:
    1
    Views:
    710
    Ken Schaefer
    Sep 9, 2003
  4. Lloyd Zusman
    Replies:
    0
    Views:
    82
    Lloyd Zusman
    Jan 22, 2005
  5. pizzy
    Replies:
    7
    Views:
    163
    pizzy
    Mar 23, 2005
Loading...

Share This Page