您可以尝试请求checked属性,请参阅示例:
原文链接:https://www.f2er.com/php/133321.html<label for="public0"><input type="radio" checked="checked" name="publicar" id="public0" value="TRUE" /> YES</label> <label for="public1"><input type="radio" name="publicar" id="public1" value="FALSE" /> NO</label>
然后在PHP中获取raddio按钮的值:$publicar = $postvars [‘publicar’];并询问其价值,以便知道它是真还是假
此外,如果您想使用javascript操纵值:
if ( $("public0").checked == true) { ...} or if ( $("public1").checked == true){...} //alert($("public0").checked); //if you want to see the value //alert($("public1").checked);
注意:$postvars = $_ POST