checkbox question
Moderator: General Moderators
-
thegreatone2176
- Forum Contributor
- Posts: 102
- Joined: Sun Jul 11, 2004 1:27 pm
checkbox question
Basiclly my code works by imploding then exploding $_POST and its working fine except that since I do it in this manner if a value is left blank i still need it to fill a spot in the array. The textboxes do this fine but not the checkboxes. so basiclly is there a way to make a checkbox post a null or blank value so that it can take up an element of an array.
I don't understand what you are doing, but with the code below you get an empty answer..
Code: Select all
<form method="post" action="">
<input type="hidden" name="answer[]" value="">
<input type="checkbox" name="answer[]" value="1"/>
<input type="checkbox" name="answer[]" value="2"/>
<input type="checkbox" name="answer[]" value="3"/>
<input type="checkbox" name="answer[]" value="4"/>
<input type="submit"/>
</form>-
thegreatone2176
- Forum Contributor
- Posts: 102
- Joined: Sun Jul 11, 2004 1:27 pm