0

I have an order form with data. on submit the controller function new_blank_order_summary is called.

the syntax for this is:

 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');
 }

I cannot get the post information to display or echo? my input Name and ID is orderlines but this is not being posted or received properly.

Apologies for the 'stupid' question.

any advice welcome.

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>

None of these posts are outputted by controller.

asked Apr 11, 2013 at 11:42
4
  • orderlinesswith double s? Commented Apr 11, 2013 at 11:50
  • sorry Mudshark, typo :-) Commented Apr 11, 2013 at 11:56
  • What does the form html look like? Commented Apr 11, 2013 at 12:02
  • why is all the input field disabled. and try to see if the html form is getting all the data you are sending or not. Commented Apr 11, 2013 at 12:10

3 Answers 3

2

You've disabled the orderlines text input field so that's why it will not get posted. Remove disabledand it will show up in $this->input->post().

answered Apr 11, 2013 at 12:08
Sign up to request clarification or add additional context in comments.

2 Comments

so disabled inputs don't get posted? how do I stop a user from editing them and still post them? they need to be displayed so hidden wont work.
You could add a hidden field with name="orderlines" value="1" which will show up in post - the (disabled) visible text field doesn't need a name in this case, it's only there as visual feedback to the user.
1

what is the name and value of your submit button. Usually the name of my submit button is name="submit" and the value is value="submit". So then I try $this->input->post('submit')=='submit'. try this in your if condition. I hope it will work. best of luck.

answered Apr 11, 2013 at 11:51

1 Comment

Thanks eddard, the if statement is working, the post of the orderlines is not though. I can place an echo 'test' inside the condition and it will display correctly. thanks again.
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');
}

Please try this code. I didn't change a single line in it. Only I put the single quotes in the 3rd line. And, changed it's variable name is wrong so I changed it

answered Apr 11, 2013 at 12:09

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.