PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am creating a table with values, each value has a check box next to it. I would like to add a box at the top that says check all so when it is checked all the boxes get checked. I tried a javascript to do this. When I did that it would check all of the boxes but did not throw these into my array (attendee_id[] ) instead it just passed in the last value(record) instead of all of them. When I manually check them all it works fine. Can anyone help me with this? I am stuck .... Thank you so much for your time. mod_edit: php tags added
Hey thanks for the replies that works. There is only one small problem. If I click the check all box then uncheck some or all of them, the uncheck box stays checked. Is there a way that if all the boxes are not checked it will take the check out of the check all box? Thanks.
That would have to be javascript. I would probably just assume that if the user had checked an "all" box it's up to them to uncheck it again if they want to select individual options - but I guess you never can predict exactly how people will interact with stuff. Maybe an explanatory note beside the "all" box could help.
McGruff wrote:That would have to be javascript. I would probably just assume that if the user had checked an "all" box it's up to them to uncheck it again if they want to select individual options - but I guess you never can predict exactly how people will interact with stuff. Maybe an explanatory note beside the "all" box could help.
Exactly, in some cases, like me, people use the 'select all' to then uncheck one instead of checking them one by one. It's a time-saver...