duanhe6799 2016-07-17 07:19
浏览 62
已采纳

严重性:警告消息:为foreach()提供的参数无效文件名:helpers / form_helper.php

I have a dynamic select ? which carries the values ​​in another select . Charging is running . However displays this Message:

Severity: Warning Message: Invalid argument supplied for foreach() Filename: helpers/form_helper.php

This is my controller:

 public function getparcelas()
{   if($this->input->post('aquiller'))
    {
        $parcelas = $this->input->post('aquiller');
        $localidades = $this->sindico->get_parcelas($parcelas);
            foreach($localidades as $fila)
        {
            ?>
            <option value="<?=$fila->numero_parcelas ?>"><?=$fila->numero_parcelas ?></option>
            <?php
        }
    }
}}

My view : This is my view

 $dados['album'] = $this->sindico->get_aquiller();
    echo "<select name='aquiller' id='aquiller' class='form-control input-sm'>";
    if (count($dados['album'])) {
        foreach ($dados['album'] as $list) {
            echo "<option value='". $list['id_alug'] . "'>" . $list['numero_apart'] . "-" . $list['nome_usu'] . "</option>";

        }
    }
    echo "</select>";
    echo form_dropdown('localidad', '', '', 'class="localidad" id="localidad"');

This is my javascript:

<script type="text/javascript">
    $(document).ready(function() {
        $("#somar").click(function(){
            var total = 0;
            $('.input').each(function(){
                var valor = Number($(this).val());
                if (!isNaN(valor)) total += valor;
            });
            $(".resultado").val(total.toFixed(2));
        });
    });
</script>
<script>
    function calcular(){
        var dt1 = document.getElementById("dt1").value;
        var dt2 = document.getElementById("dt2").value;

        var data1 = new Date(dt1);
        var data2 = new Date(new Date(dt2));
        var total = (data2.getFullYear() - data1.getFullYear())*12 + (data2.getMonth() - data1.getMonth());
        document.getElementById("result").value = total;
    }
</script>
  • 写回答

2条回答 默认 最新

  • duandushang5148 2016-07-17 07:31
    关注

    You problem lies in form_helper.php means this line of code calling it.

    echo form_dropdown('localidad', '', '', 'class="localidad" id="localidad"');
    

    Now this function form_dropdown expect one parameter to be an array. It could be 2nd or third. Make sure you have read documentation to this function.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?