HTML Input Radio Value="false" Posts NULL
In FireFox, I have a radio input with it's value set to the string "false" (not sure if there's any possible distinction from boolean false).
<input name="test_1" type="radio" value="false" />
When I post the form, I get:
print_r($_POST["test_1"]);
Array
(
[test_1] =>
)
Which suggests that the brows开发者_如何学编程er casts the string "false" to Boolean FALSE or NULL.
What is the expected behavior?
What if I specifically want the string "false" to be returned?
My understanding is that if the radio button is checked the value is POSTed otherwise an empty string is sent. In your case if the radio button is checked "false" will be sent otherwise an empty string is sent.
精彩评论