Checkbox 具体化复选框返回值
我在表单中使用复选框,如下所示Checkbox 具体化复选框返回值,checkbox,materialize,Checkbox,Materialize,我在表单中使用复选框,如下所示 <form action="" method="get"> <p> <input type="checkbox" id="blunch" /> <label for="blunch">Burrito Lunch</label> </p> <p> <input type="checkbox" id="trip" /&g
<form action="" method="get">
<p>
<input type="checkbox" id="blunch" />
<label for="blunch">Burrito Lunch</label>
</p>
<p>
<input type="checkbox" id="trip" />
<label for="trip">Ski Trip</label>
</p>
<p>
<input type="checkbox" id="dance" />
<label for="dance">Snowball Dance</label>
</p>
<button class="btn btn-primary btn-lg waves-effect waves-light" id="submit" type="submit">Submit</button>
</form>
玉米煎饼午餐
滑雪旅行
雪球舞
提交
当我尝试查看选中复选框后的输出时,它只显示为问号。有没有办法确定结果的名称?
name
属性用于标记发送到服务器的消息中的字段,该消息使用HTTP
(超文本传输协议)GET
或POST
在表单中单击submit。您必须通过name
属性为输入字段指定name
。您已经给出了id
s,这就是您面临问题的原因
检查此代码
<form action="" method="get">
<p>
<input type="checkbox" id="blunch" name="blunch" />
<label for="blunch">Burrito Lunch</label>
</p>
<p>
<input type="checkbox" id="trip" name="trip" />
<label for="trip">Ski Trip</label>
</p>
<p>
<input type="checkbox" id="dance" name="dance" />
<label for="dance">Snowball Dance</label>
</p>
<button class="btn btn-primary btn-lg waves-effect waves-light" id="submit" type="submit">Submit</button>
</form>
玉米煎饼午餐
滑雪旅行
雪球舞
提交
不清楚您在问什么。您所说的结果名称是什么意思?复选框只能选中布尔属性。我的意思是,如果方法是get,它将在栏中显示什么@因为现在它是从file:///C:/Users/Abhi/Documents/material-设计模板/www/index.html至file:///C:/Users/Abhi/Documents/material-设计模板/www/index.html?