Php HTML应用程序“;复选框“;回答
我试图让应用程序上的“复选框”响应php文件。目前,它正在响应并提供应用程序页面上的所有复选框,但我需要选中的复选框 HTMLPhp HTML应用程序“;复选框“;回答,php,html,post,checkbox,Php,Html,Post,Checkbox,我试图让应用程序上的“复选框”响应php文件。目前,它正在响应并提供应用程序页面上的所有复选框,但我需要选中的复选框 HTML <div class="input-group"> <div class="btn-group input-group form-group" data-toggle="buttons"> <label class="btn purplebtn"> <input type="checkbo
<div class="input-group">
<div class="btn-group input-group form-group" data-toggle="buttons">
<label class="btn purplebtn">
<input type="checkbox" id="math_select" value= "math_select" />
MATH
</label>
<label class="btn purplebtn">
<input type="checkbox" id="science_select" value="science_select" />
SCIENCE
</label>
... (I have 6 other selections) ...
</div>
</div>
然后,我的应用程序显示所有选项,而不是填写表单时实际选择的内容
谢谢PHP使用name属性。正确答案是:
<input type="checkbox" name="math_select" value= "math_select">
<input type="checkbox" name="science_select" value= "science_select">
复选框选中时返回其值,未选中时不返回任何内容。
<input type="checkbox" name="math_select" value= "math_select">
<input type="checkbox" name="science_select" value= "science_select">