Select All Check Box

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!

Moderator: General Moderators

Post Reply
michaelk46
Forum Commoner
Posts: 67
Joined: Mon Oct 12, 2009 9:50 pm

Select All Check Box

Post by michaelk46 »

Does anyone know of a way to implement a 'Select All' Checkbox in PHP and not Javascript?
User avatar
SimpleManWeb
Forum Commoner
Posts: 57
Joined: Wed Dec 30, 2009 4:15 pm
Location: New Hampshire, USA

Re: Select All Check Box

Post by SimpleManWeb »

The only way that would be possible would be if your "Select All" was a link which refreshed the page. You could then hand in a "$_GET" variable that was something like index.php?SelectAll=1. Then, use that variable to set the selected value for all check boxes. This is definitely not the recommended way to handle something like this though, javascript is. Any reason why you don't want to use javascript?
michaelk46
Forum Commoner
Posts: 67
Joined: Mon Oct 12, 2009 9:50 pm

Re: Select All Check Box

Post by michaelk46 »

I haven't learned it yet and was hoping I could find a work around until I do. Oh well, I'll just wait.

Thanks for the help
User avatar
SimpleManWeb
Forum Commoner
Posts: 57
Joined: Wed Dec 30, 2009 4:15 pm
Location: New Hampshire, USA

Re: Select All Check Box

Post by SimpleManWeb »

I bet that if you do a google search for `Javascript check all checkboxes` you'll find some code that you could pretty much copy and paste.

Good luck
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Select All Check Box

Post by McInfo »

A good place to start learning JavaScript is Eloquent JavaScript.

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 4:31 pm, edited 1 time in total.
michaelk46
Forum Commoner
Posts: 67
Joined: Mon Oct 12, 2009 9:50 pm

Re: Select All Check Box

Post by michaelk46 »

Thanks for the suggestions... I'll definitely check them out
Post Reply