doujiene2845 2015-09-14 05:42
浏览 62

Bootstrap Dual Listbox发送

I'm using Bootstrap Dual Listbox to select multiple data and to show the user how many persons will be in a oficial list and who won't. You can see an example on this page: http://www.virtuosoft.eu/code/bootstrap-duallistbox/

The point is that, even though it works, I would like to know How do I know which box has the selected items and send them through POST using PHP, because the only "select" tag that you can see in HTML is the only one with all the options that you want to select, and when you are moving the data side to side it creates to containers dynamically call box1 and box2.

The code it is almost the same of this link, 'cause I couldn't write down the code here,don't know why it didn't display all the code (new one): Bootstrap Dual Listbox : How to Limit Selected Option, but is not the question that I was looking for.

Hope you understand my point!!

Thank you very much!

  • 写回答

2条回答 默认 最新

  • doucigua0278 2016-01-18 18:31
    关注

    My view:

    {!! Form::open(['class'=>'form-horizontal','role'=>'form']) !!}
        <select multiple="multiple" size="10" name="facturas[]" id="selectfacturas">
            @foreach($facturas as $factura)
                <option value="{{ $factura->id }}"{{ ( $factura->ordendepago_id==$op->id ? ' selected="selected"':'') }}>{{ $factura->descripcionLinda() }}</option>
            @endforeach
        </select>
        <script>
            var demo2 = $('#selectfacturas').bootstrapDualListbox({
              nonSelectedListLabel: 'Comprobantes disponibles',
              selectedListLabel: 'Comprobantes imputados a esta orden',
              preserveSelectionOnMove: 'moved',
              moveOnSelect: false,
              showFilterInputs: false,
            });
        </script>
        {!!Form::submit( 'Siguiente',array('class'=>'btn btn-primary','id'=>'btn-submit'))!!}
        {!!Form::close()!!}   
    

    Then, in my controller:

    public function selefacturasPost( $id ) {
        dd( \Input::All()  );
    

    It returns an Array!

        array:2 [▼
      "_token" => "YTlypLsDjO37GGTAHXcKcKfho1vKYx5c0xgDN1cM"
      "facturas" => array:2 [▶]
    ]
    
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么