IIS ASP - Post recurring checkboxes/radio buttons?

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > May 2005 > Post recurring checkboxes/radio buttons?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Post recurring checkboxes/radio buttons?
wolfing1@yahoo.com

2005-05-23, 5:59 pm

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

2005-05-23, 5:59 pm

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[i].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


<wolfing1@yahoo.com> wrote in message
news:1116878685.851026.130740@g47g2000cwa.googlegroups.com...
> 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).
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com