PHP/JS check all, uncheck all button for checkboxes
Posted: Fri Nov 24, 2006 8:39 am
Hi guys.
I would really appreciate some help with this as I cant for the life of me get it to work.
I have a series of checboxes created in a php script. The name of the checboxes is weeks[]. This creates an array when the different weeks are seelected so I can input all the weeks that are checked into a DB.
However, just to make things easier I want to create a button that checks and unchecks all the checboxes to make things easier. I have tried adding some javascript but I don't think it likes it when I use an array as the checkbox name. Does anyone know how I can do this while maintaining the array?
thanks alot
I would really appreciate some help with this as I cant for the life of me get it to work.
I have a series of checboxes created in a php script. The name of the checboxes is weeks[]. This creates an array when the different weeks are seelected so I can input all the weeks that are checked into a DB.
However, just to make things easier I want to create a button that checks and unchecks all the checboxes to make things easier. I have tried adding some javascript but I don't think it likes it when I use an array as the checkbox name. Does anyone know how I can do this while maintaining the array?
thanks alot