Q:

Checkbox value comes in as empty string through POST in PHP

So my html is:
<form action="/product/additem" method="post" enctype="multipart/form-data">
    <input type="checkbox" name="item_active" id="item_active" value="Yes" />
    *** more input types but all of them are type file & text
</form>

Now in my PHP I do this:
var_dump($_POST['item_active']);

and this is what I get:
string(0) ""

NOTE:
My javascript code that does the actual .submit
$('#button').on('click', function() {
   $('#new_item_container form').submit();
});

What is wrong with my checkbox I dont get it. I am using Firefox

A:

Do you have any other <form> tags ahead or around this form?  This is a shot in the dark, but I had this problem last week, and was pulling my hair out, until I found that the form I was looking at, was actually nested inside another form, and that changes the behavior.  If the other form has the same named value, it can (in some cases, apparently) take precedence and prevent you from seeing the value that you think you are getting.

