CodeIgniter Forums

Full Version: form_open() Error MSG: Trying to get property of non-object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using this form post with jQuery Datatables
I am getting a error on the page when it loads indicating "Message: Trying to get property of non-object"

<?php echo form_open('myController/ajaxSaveProduct/' . $this->encryption->encrypt($productData->id), array('method' => 'POST', 'role' => 'form', 'accept-charset' => 'utf-8', 'enctype' => "multipart/form-data", 'id' => 'productForm'));

<table id="productTable">
<td>Tire</td><td>Large Black Tire</td><td>Desc 1435</td>
<button id="saveProduct">Save</button>

<select style="width:100%;" name="value[1]" data-bind="value: product_1" id="product_1" class="form-control" onchange="valueChange()">
<option value="">Choose Yes / No</option><option value="yes">Yes</option><option value="no">No</option></select></td></tr><tr id="62" data-attribute-attributeid="62" data-attribute-controltypeid="1" data-attribute-description="Desc 1428" data-attribute-title="Test MA 1428" role="row" class="even"><td>Test MA 1428</td><td>Desc 1428</td><td><input style="width:100%;" type="text" name="attributeValues[62]" data-bind="value: attribute_62" id="attribute_62" value="xxxx-0001" class="form-control" onchange="ckValueChange()"></td></tr><tr id="2" data-attribute-attributeid="2" data-attribute-controltypeid="9" data-attribute-description="Locations receive small red box" data-attribute-title="SMALL Red Box Carton" role="row" class="odd"><td>SMALL Red Box Carton</td><td>Locations receive small red box</td>

<td><select name="productValue[1]" data-bind="value: product_1" id="product_1" class="form-control" onchange="changeValue()"><option value="">Choose Yes / No</option><option value="yes">Yes</option><option value="no">No</option></select></td></tr>


What have you done to trouble shoot the issue? Have you removed any items from the forms to see if it works? Do you have any ideas what is causing the error?
form_open() should be form_open_multipart()

Then remove the arry field multipart/form-data


CodeIgniter User's Guide - form_open_multipart