Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
counting number of checkboxes checked
Old 11-26-2008, 04:57 PM counting number of checkboxes checked
melefire's Avatar
Experienced Talker

Posts: 46
Name: matt
Trades: 0
So i a html form consisting of about 50 checkboxes. It then POSTS to the php page that should count how many boxes were checked.

However i am unsure of how one would go about counting all the checked boxes. Any help??


thanks
melefire is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-26-2008, 06:07 PM Re: counting number of checkboxes checked
Skilled Talker

Posts: 62
Name: Tom Wright
Location: Brighton, UK
Trades: 0
If I remember correctly, the easy way to do this is to give the check boxes names that will cause them to form an array when POSTed (i.e. 'boxes[box1]').
Then in the PHP, you can just do
PHP Code:
$checked count($_POST['boxes']); 
Hope this helps.
Tom
__________________
My site:
Please login or register to view this content. Registration is FREE
tomythius is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to counting number of checkboxes checked
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10116 seconds with 12 queries