我的表单只给出了最喜欢的饮料数据,感谢任何帮助。 我想输出表单中给出的所有信息。
<form action="https://learn.nucamp.co/show_everything.php" method="post">
<label for="name">Name</label>
<input type="text" id="name" value="name" text="name" />
<label for="rating">Your Rating:</label> 1 <input type="range" id="rating" value="rating" min="1" max="5" /> 5
<label for="comments">Comments:</label>
<input type="text" id="comments" value="comments" text="name" />
<label>Choose your favorite drink:</label>
<input type="checkbox" name="drink" value="coffee" /> Coffee
<input type="checkbox" name="drink" value="Tea" /> Tea
<input type="checkbox" name="drink" value="Juice" /> Juice
<input type="submit" id="submit-btn" class="button" />
</form>
除了饮料复选框之外,其他所有的输入都缺少一个 "最喜欢的饮料"。name=
属性,所以没有提交。