Post recurring checkboxes/radio buttons?

Discussion in 'ASP General' started by wolfing1@yahoo.com, May 23, 2005.

  1. Guest

    I'd like to have an 'approve' and 'reject' option for each record in a
    list, and a 'process' button. When this button it's pressed, then it
    would post to the same page which would update (or add) records in the
    database depending on if the approve or reject option is checked.
    Originally, I set up radio buttons with the same name, but obviously,
    that didn't work. Then I set checkboxes, which could work (I could
    then do a split(request.form("cbox") to process each record I guess),
    but can't make it so when I select the 'Approve' checkbox in a row, the
    'Reject' checkbox is cleared (I used
    onclick="formname.rejected.checked=false" but that didn't do anything).
    As you can see I'm rather new at this, what would be a good way to do
    what I want (basically, being able to process each record depending on
    which checkbox was marked).
     
    , May 23, 2005
    #1
    1. Advertising

  2. Mark Schupp Guest

    If you have more than one checkbox then you access them as an array.
    For example, this script sets all the student_id checkboxes in a form:

    function selectall(theForm)
    {
    var i;
    var formobj = theForm.student_id;

    if( formobj.length == null )
    {
    //single checkbox
    formobj.checked = 1;
    }
    else
    {
    //multiple checkboxes
    for( i = 0; i < formobj.length; i++ )
    {
    formobj.checked = 1;
    }
    }
    }

    You will need to identify the checkbox the changed (or just check them all)
    and set or clear the other checkbox accordingly.

    You should follow up in a client-side scripting group. You'll probably get
    more assistance.

    --
    --Mark Schupp


    <> wrote in message
    news:...
    > I'd like to have an 'approve' and 'reject' option for each record in a
    > list, and a 'process' button. When this button it's pressed, then it
    > would post to the same page which would update (or add) records in the
    > database depending on if the approve or reject option is checked.
    > Originally, I set up radio buttons with the same name, but obviously,
    > that didn't work. Then I set checkboxes, which could work (I could
    > then do a split(request.form("cbox") to process each record I guess),
    > but can't make it so when I select the 'Approve' checkbox in a row, the
    > 'Reject' checkbox is cleared (I used
    > onclick="formname.rejected.checked=false" but that didn't do anything).
    > As you can see I'm rather new at this, what would be a good way to do
    > what I want (basically, being able to process each record depending on
    > which checkbox was marked).
    >
     
    Mark Schupp, May 23, 2005
    #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. =?Utf-8?B?RGFiYmxlcg==?=
    Replies:
    4
    Views:
    9,344
    Garth Wells
    Mar 19, 2006
  2. BillE
    Replies:
    2
    Views:
    497
    BillE
    Nov 13, 2007
  3. lmeacham

    Radio buttons/checkboxes

    lmeacham, Oct 24, 2003, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    151
    Jacob Yang [MSFT]
    Oct 29, 2003
  4. Newbie
    Replies:
    2
    Views:
    259
    Newbie
    Jul 7, 2003
  5. Replies:
    3
    Views:
    154
    Lasse Reichstein Nielsen
    Jun 24, 2004
Loading...

Share This Page