Newbie yet & this is the first time i'm working with dynamic fields, please check this video first.
http://www.screencast.com/t/Tl8jWxztdfG6
As i demonstrated i have this input field in my form (view).
what i need to know is, how can i store the values of these generating fields in database. there are other fields in this form as well i have already know & saving the results to the database using below model.
Model
in the model at the moment i'm not saving the data of joblist as you can see, because if i do so it only save default fields value but no others.
my table is "jobsheets" on this table i have field called "faults_reported_by_customer" and this is where i need the data from my dynamic input fields needs to store. how can i achive this prefer some coding level guidance as i am clueless.
also is it possible to store is result in separate row of database? i really appreciate your help on this.
http://www.screencast.com/t/Tl8jWxztdfG6
As i demonstrated i have this input field in my form (view).
Code:
<input type="text" name="fault[0]" placeholder="" class="form-control name_list" />
<button type="button" name="add" id="add_fault_fld" class="btn btn-success">Add More</button>what i need to know is, how can i store the values of these generating fields in database. there are other fields in this form as well i have already know & saving the results to the database using below model.
Model
PHP Code:
public function new_jobsheet_save() {
$new_job_insert_db = array(
'cus_name'=> $this->input->post('cusname'),
'vehicle_number'=> $this->input->post('vehicles'),
'date_in'=> $this->input->post('datein'),
'date_out'=> $this->input->post('dateout'),
'expected_completion'=> $this->input->post('datecom'),
'mileage_in'=> $this->input->post('mileagein'),
'mileage_out'=> $this->input->post('mileageout'),
'service_advisor'=> $this->input->post('serviceadvisor'),
);
$insert = $this->db->insert(' jobsheets', $new_job_insert_db);
return $insert;
}
in the model at the moment i'm not saving the data of joblist as you can see, because if i do so it only save default fields value but no others.
my table is "jobsheets" on this table i have field called "faults_reported_by_customer" and this is where i need the data from my dynamic input fields needs to store. how can i achive this prefer some coding level guidance as i am clueless.
also is it possible to store is result in separate row of database? i really appreciate your help on this.