473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Post recurring checkboxes/radio buttons?

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

Jul 22 '05 #1
1 1470
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
<wo******@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.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).

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Gary | last post by:
Hello, Is it possible to dynamically update a textbox with words chosen from a list using form checkboxes and javascript? Gary
1
by: sman | last post by:
Hi, I recently read this article on About.com on how to create required fields for a form: http://javascript.about.com/library/scripts/blformvalidate.htm Everything works great except that there...
2
by: Glenn | last post by:
The following script is supposed to have high categories as radio buttons and mid categories as check boxes. Clicking the radio button is supposed to select all checkboxes under it and submit the...
4
by: moondaddy | last post by:
There are different times when I will have a group of checkboxes and need to force only one to be checked at a time. I would also like to do this client side and not require a postback. These...
10
by: apparker | last post by:
I'm creating a new GUI for a program and it is for a medical exam. There are so many different things to ask someone during a history it wastes too much space to make checkboxes for everything so I...
3
by: mountain.dog | last post by:
I have a query that shows a list of options that a user can toggle on or off using a checkbox. query... form... while($row = mysql_fetch_array($result))... <input name="menu_show_attribute"...
2
by: forbes | last post by:
Hi, I have a form that contains multiple groups of checkboxes that act like radio buttons (at the clients insistance). There is one text field that is required and 28 checkbox groups. Here an...
2
by: BillE | last post by:
Users of a VS2005 asp.net web forms application can complete questionnaires, and when they are completed the questionnaires can be viewed but not modified. Once completed, the controls in the...
2
by: leifstarkey | last post by:
Hi all... My problem is I'm trying to make a form containing radio buttons and checkboxes. But on the event that one of the radio buttons is selected i want specific checkboxes to then be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.