【发布时间】:2020-03-30 20:11:23
【问题描述】:
这里是代码。有一个搜索栏,用户可以在其中输入一个主题,然后选择一个显示不同类别的按钮。
<form action="search.php" method="GET">
<i class="fas fa-search" aria-hidden="true"></i>
<input placeholder="Search" name="search" aria-label="Search">
<input type="submit" value="S" class="searchButton" name="submit-request"/>
<div class="buttons" style="text-align:center;">
<input type="button" class="spec" name="category1" value="category1">
<input type="button" class="spec" name="category2" value="category2">
<input type="button" class="spec" name="category3" value="category3">
<input type="button" class="spec" name="category4" value="category4">
<input type="button" class="spec" name="category5" value="category5">
</div>
</form>
此搜索表单与复选框完美配合。作为替代方案,我应该怎么做?有没有办法可以将复选框设置为按钮。如果它们是复选框,我该怎么做才能让用户只能选择一个类别。
【问题讨论】: