checked AND unchecked

Discussion in 'ASP General' started by Joel Brabant, Sep 22, 2003.

  1. Joel Brabant

    Joel Brabant Guest

    Hi again,

    Within a submitted page that has mutilple checkboxes with
    the same name, the request.form("mycheckboxes") has a
    comma separated list of the values of all the ones
    checked....
    but I also need to know which ones are not checked... How
    can I know that ?

    Thanks.
     
    Joel Brabant, Sep 22, 2003
    #1
    1. Advertising

  2. Joel Brabant

    Tom B Guest

    It's the rest of them ;)

    You need to either go get them again, or include all the values in a hidden
    field.

    I'm assuming your checkboxes are coming from a database. So you could
    requery the database and compare the returned values with those submitted.

    OR

    On your form, you can put in a hidden field with all the values in it.
    <input type=hidden name=AllPossibleCheckboxValues value="1, 2, 3, 4, 88">


    "Joel Brabant" <> wrote in message
    news:105001c3813e$67eebb00$...
    > Hi again,
    >
    > Within a submitted page that has mutilple checkboxes with
    > the same name, the request.form("mycheckboxes") has a
    > comma separated list of the values of all the ones
    > checked....
    > but I also need to know which ones are not checked... How
    > can I know that ?
    >
    > Thanks.
     
    Tom B, Sep 22, 2003
    #2
    1. Advertising

  3. Joel Brabant

    Ray at Guest

    They will not be returned in the form collection if they are not checked.
    How are the checkboxes being created? Can you not pull from the same source
    to get that information?

    You could use a hidden input on your form and then compare the values:

    <inpt type="checkbox" name="chk1" value="1">
    <inpt type="checkbox" name="chk1" value="2">
    <inpt type="checkbox" name="chk1" value="3">
    <inpt type="checkbox" name="chk1" value="4">
    <input type="hidden" name="allPossibleValues" value="1,2,3,4">

    Ray at work


    "Joel Brabant" <> wrote in message
    news:105001c3813e$67eebb00$...
    > Hi again,
    >
    > Within a submitted page that has mutilple checkboxes with
    > the same name, the request.form("mycheckboxes") has a
    > comma separated list of the values of all the ones
    > checked....
    > but I also need to know which ones are not checked... How
    > can I know that ?
    >
    > Thanks.
     
    Ray at, Sep 22, 2003
    #3
    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. Wendy S
    Replies:
    0
    Views:
    1,844
    Wendy S
    Feb 18, 2004
  2. Ahmed Moustafa
    Replies:
    5
    Views:
    30,098
    Chris Smith
    Jul 14, 2004
  3. exquisitus
    Replies:
    4
    Views:
    8,377
    Patricia Shanahan
    May 6, 2005
  4. runescience
    Replies:
    0
    Views:
    4,308
    runescience
    Feb 23, 2006
  5. RVic
    Replies:
    19
    Views:
    1,432
Loading...

Share This Page