[eluser]buckboru[/eluser]
I receiving this error when trying to load data into an edit form.
Scenario
Load a table. Select a record from table and load the specific record into form to edit.
Controller snippet.
Code:
function edit_phone($id = false)
{
$this->form_validation->set_rules('lastname', '', '');
if (!$id) redirect ('phonelist/list_users');
$data['phonelist'] = $this->phone_model->get_phone($id);
$this->load->view('phone_edit',$data);
View snipped
Code:
echo form_open('/phonelist/edit_form/'.$this->uri->segment(3) );
echo form_label('Last Name', 'Last' ).' ';
$data = array(
'name' => 'lastname',
'id' => 'lastname',
'value' => set_value('lastname', (isset($phonelist['LAST_NAME'])) ? $phonelist['LAST_NAME'] : ''),
'maxlength' => '25',
'size' => '25',
'style' => ''
);
echo form_input(set_value($data)).'<br />' ;
value of $data prior to the form_input statement.
$data = Array[6]
id = (String:8)lastname
maxlength = (string:2)25
name = (String:8)lastname
size = (string:2)25
style = (string:0)
value = (string:30)Smith
I just can't figure out what the problem is.
I appreciate any help you can provide.
Thanks