I just ran into this problem myself. I solved it by adding a duplicate hidden
field with the same name. When the browser sends this information, the second field overrides the first (so ensure that the hidden
field comes first).
<input type="hidden" name="foo" value="">
<input type="checkbox" name="foo" value="bar">
If the checkbox
is not checked you get:
$_REQUEST[ 'foo' ] == ""
If the checkbox
is checked you get:
$_REQUEST[ 'foo' ] == "bar"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…