【问题标题】:How to make a checkbox? if (checkbox) set to enable filter by field如何制作一个复选框? if(复选框)设置为启用按字段过滤
【发布时间】:2020-07-28 13:35:39
【问题描述】:

如何确保设置了 if (checkbox),然后通过 sport_id 字段启用过滤器,并且仅在 sport_id 字段中有“1”的位置显示那些行。甲骨文数据库

<form action=" " method="post">
  <input type="checkbox" name="sport_id" value="1">
</form>

<div class="col-xs-6 col-md-3">
 <p></p>
 <div class="checkbox">
   <label>
     <?php echo form_checkbox('sport_id', sport::checkboxValid(), 
        ($this->input->get('sport_id') > 0) ? 'checked="checked"' : '')?>
   </label>
 </div>
</div>

【问题讨论】:

  • 要么我从你的问题中遗漏了一些东西,要么你需要:1. 使用 &lt;input ... 中的 PHP 部分或 2. 使用 JavaScript 更新一些更改。
  • 你能提供更多细节吗?我只是第一次尝试这样做
  • &lt;div class="checkbox"&gt; &lt;label&gt; &lt;input type="radio" value="contact" name="type" {{ old('type', $menu-&gt;type) === 'contact' ? 'checked' : '' }}&gt; Contact &lt;/label&gt; &lt;/div&gt; &lt;/div&gt; 签入与您类似的框架:laracasts.com/discuss/channels/general-discussion/…

标签: php html database checkbox filter


【解决方案1】:

你可以在if()条件下使用

isset($_POST['sport_id'])

【讨论】:

  • 你能提供更多细节吗?我只是第一次尝试这样做
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-08-28
  • 1970-01-01
  • 2021-01-26
  • 1970-01-01
  • 2019-08-13
  • 1970-01-01
相关资源
最近更新 更多