473,508 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select All Check boxes Not working

228 New Member
Hi,
I am using checkboxes for the user to select at once. The form is passed back to PHP and is processed. The processig is done very good but select all is not working at all. The checkboxes are formed in this way:

<name="chks[]" value="1">

the javascript works fine (but php does not) if i do it like this:

<name="chks" value="1">

how can i come around this problem?
Feb 13 '09 #1
4 1622
Dormilich
8,658 Recognized Expert Moderator Expert
@samvb
can you elaborate the problem a bit more, this would make understanding easier.
Feb 13 '09 #2
Markus
6,050 Recognized Expert Expert
Why not give the checkboxes a class, and use javascript's getElementsByClassName() and then set the checkboxs' checked attribute.

Expand|Select|Wrap|Line Numbers
  1. <input type="checkbox" name="boxes[]" class="boxes" />
  2.  
Feb 13 '09 #3
hsriat
1,654 Recognized Expert Top Contributor
@Markus
Your beloved IE is in bad relationships with JavaScript!

@samvb
I wonder what kind of new markup is this!

Did you try something like this?
Expand|Select|Wrap|Line Numbers
  1. <input 
  2.     type="checkbox"
  3.     onclick="
  4.         var ee = getElementsByName('ee[]');
  5.         for (var i=0; i<ee.length; i++)
  6.         ee[i].checked = this.checked;"
  7.  />Select All<br />
  8. <input
  9.      type="checkbox"
  10.      name="ee[]"
  11.      value="1"
  12. />1<br />
  13. <input
  14.      type="checkbox"
  15.      name="ee[]"
  16.      value="2"
  17. />2<br />
Feb 14 '09 #4
samvb
228 New Member
@Markus

could you plz elaborate it more? i wanna gv it a shot.
Feb 14 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3591
by: Mohammed Mazid | last post by:
Hi folks! Can anyone please help me with this? I am developing a Quiz program but I am stuck with "multiple answers". Basically I need some sort of code that would select multiple answers...
0
1951
by: Robert | last post by:
Stephen, I think I figured out the problem. I was able to get Check Boxes and Option Buttons to work on my form by TURNING OFF RECORD SELECTORS on the form. Not sure why this would make a...
5
2121
by: Allan M. | last post by:
I have a series of select boxes that must be populated client side, because they interact with each other. The design specification calls for these boxes to be updated without having to make a...
5
3682
by: jjyconsulting | last post by:
Newbie needing some help. I have a tblParticipants. The fields include gender, education_level, income, occupation etc., I'm trying to create a form where a user can run a query from the form and...
25
5364
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. ...
2
2734
by: woodey2002 | last post by:
Hi Guys and thanks for your time. I have a search form for my database that allows users to select multiple criteria from multi select list boxes. I successfully integrated a multi select...
6
4653
by: woodey2002 | last post by:
Hi Everyone. Thanks for your time. I am trying to create a search form that will allow users to select criteria from multiple multi select boxes. So far i have managed to achieve a search option...
1
6767
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
45
27637
by: dizzydangler | last post by:
Hi, I'm new to access (2007, running on XP), but I've gotten some great help from this site on my project so far. However, the more I know, the more complex the problems seem to become.... I'm...
0
7135
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
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7410
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...
1
7067
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
7505
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
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.