How do I pass an empty checkbox value?

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
sjk1000
Forum Commoner
Posts: 26
Joined: Tue Nov 11, 2008 8:50 am

How do I pass an empty checkbox value?

Post by sjk1000 »

Hi all
I need to pass a empty checkbox value to an array. The script below is from a loop that may be repeated n times. I need all checked and unchecked values to be stored in the array. At the moment if l have 6 rows unchecked followed by 2 rows checked, the output array only has 2 elements. How do I deal with this?
Thanks, Steve
:)

Code: Select all

print "<TD align = center><INPUT type='checkbox' name='remove[]' id='remove' VALUE = 'Yes'></TD></TR>";
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: How do I pass an empty checkbox value?

Post by requinix »

You cannot get the checkboxes that were left unchecked. You must find out what options where available, which were selected, and the difference will be the ones not chosen.
Post Reply