0

我有一个带有数据的订单。在提交时new_blank_order_summary调用控制器函数。

语法是:

    function new_blank_order_summary() 
  {
      echo "orderlines: ".$this->input->post(orderlines);
      echo "customer: ".$this->input->post('customer');
      echo "period: ".$this->input->post('period');
      echo "creditlimit: ".$this->input->post('creditlimit');   

      $this->load->view('sales/new_blank_order_summary');

  }

我无法让帖子信息显示或回显?我输入的姓名和 ID 是orderlines,但未正确发布或接收。

为“愚蠢”的问题道歉。

欢迎任何建议。

HTML

<form id="sales_blank_order_details" action="/sales/new_blank_order_summary" method="post">


            <table >
                <tr><td>Customer</td><td>Period</td><td>UoM</td><td>Credit Limit</td><td>Balance</td><td>New Balance</td><td>Order Lines</td><td>Round to Bundle</td></tr>
                    <tr><td>
            <input type="text" name="customer" id="customer" value="<?php echo $customer; ?>" disabled>
               </td><td>
            <input type="text" name="period" id="period" value="<?php echo $period." to ".$newperiod; ?>" disabled>
               </td><td>
            <input type="text" name="buom" id="buom" value="<?php echo $buom; ?>" disabled>
               </td><td>
            <input type="text" name="creditlimit" id="creditlimit" value="<?php echo $creditlimit['creditlimit']; ?>" disabled>
           </td><td>
            <input type="text" name="currentbalance" id="currentbalance" value="<?php echo $creditlimit['currentbalance']; ?>" disabled>
           </td>
           <td>
            <input type="text" name="newbalance" id="newbalance" value="<?php echo $creditlimit['currentbalance']; ?>" disabled>
           </td><td>
            <input type="text" name="orderlines" id="orderlines" value="1" disabled>
           </td><td>
            <input type="checkbox" name="rounduptobundle" id="rounduptobundle" checked>
           </td></tr></table>

<input type="submit" name="blank_order_lines" id="blank_order_lines" value="Save Order and Proceed">

</form>

这些帖子都不是由控制器输出的。

4

3 回答 3

2

您已禁用orderlines文本输入字段,这就是它不会被发布的原因。删除disabled,它将显示在$this->input->post().

于 2013-04-11T12:08:59.330 回答
1

提交按钮的名称和值是什么。通常我的提交按钮的名称是 name="submit",值是 value="submit"。然后我尝试 $this->input->post('submit')=='submit'。在你的 if 条件下试试这个。我希望它会奏效。祝你好运。

于 2013-04-11T11:51:07.047 回答
0
function new_blank_order_summary() 
{
      echo "orlderlines: ".$this->input->post('orderlines');
      echo "customer: ".$this->input->post('customer');
      echo "period: ".$this->input->post('period');
      echo "creditlimit: ".$this->input->post('creditlimit');   

      $this->load->view('sales/new_blank_order_summary');

}

请尝试此代码。我没有更改其中的一行。只有我把单引号放在第 3 行。而且,改变它的变量名是错误的,所以我改变了它

于 2013-04-11T12:09:51.517 回答