Post recurring checkboxes/radio buttons?

W

wolfing1

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).
 
M

Mark Schupp

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top