Bootstrap Select插件-如何提交表单? [英] Bootstrap Select plugin - how to submit the form with it?

查看:555
本文介绍了Bootstrap Select插件-如何提交表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Bootstrap Select插件用于正在构建的表单.但是所选的值不会提交到$ _POST中.有人对这个Bootstrap插件有经验吗?预先感谢.

I'm trying to use Bootstrap Select plugin for a form I'm building. But the values selected don't get submitted into $_POST. Anybody has any experience with this Bootstrap plugin? Thanks in advance.

推荐答案

这些链接可能有助于获取选择输入的发布值:

These links might be helpful for get the post values of select input:

http://www.html-form- guide.com/php-form/php-form-select.html

http://www.formget.com/php -select-option-and-php-radio-button/

通常,引导程序选择输入如下:

Generally bootstrap select input is as follows:

<div class="form-group">
  <label for="sel1">Select list:</label>
  <select class="form-control" id="sel1">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
  </select>
</div>

在引导选择输入中未指定 name 属性,因此您必须添加 name 属性以发布选择列表的选定值.

Here name attribute is not specified in bootstrap select input, so you have to add name attribute to post the selected value of select list.

<div class="form-group">
      <label for="sel1">Select list:</label>
      <select class="form-control" id="sel1" name="Color">
        <option>1</option>
        <option>2</option>
        <option>3</option>
        <option>4</option>
      </select>
    </div>

这篇关于Bootstrap Select插件-如何提交表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆