[eluser]Edy S[/eluser]
Hi everybody, i just new in codeIgniter, can every body help me proceed my array post input ?
Here the part of my code
Code:
//create table for action
echo form_input().
'<table id="resep" class="tbmodule">'.
'<tr>'.
'<td class="title">No</td>'.
'<td class="title">Jenis Obat'.
'</td>'.
'<td class="title">Jumlah</td>'.
'<td class="title">Dosis</td>'.
'</tr>'.
'<tr><td>1</td><td>'.form_input('obat[1]','','size="30"').'</td> <td>'.form_input('jumlah[1]','','size="10"').'</td> <td>'.form_input('dosis[1]','','size="10"').'</td></tr>'.
'<tr><td>2</td><td>'.form_input('obat[2]','','size="30"').'</td> <td>'.form_input('jumlah[2]','','size="10"').'</td> <td>'.form_input('dosis[2]','','size="10"').'</td></tr>'.
'<tr><td>3</td><td>'.form_input('obat[3]','','size="30"').'</td> <td>'.form_input('jumlah[3]','','size="10"').'</td> <td>'.form_input('dosis[3]','','size="10"').'</td></tr>'.
'<tr><td>4</td><td>'.form_input('obat[4]','','size="30"').'</td> <td>'.form_input('jumlah[4]','','size="10"').'</td> <td>'.form_input('dosis[4]','','size="10"').'</td></tr>'.
'<tr><td>5</td><td>'.form_input('obat[5]','','size="30"').'</td> <td>'.form_input('jumlah[5]','','size="10"').'</td> <td>'.form_input('dosis[5]','','size="10"').'</td></tr>'.
''.
'</table>'.
form_close();
in my controller, i want to use data parse that contain like this ( just part ) :
Code:
foreach($this->input->post('obat') as $key => $val){
$resep .=$val.'||'.$this->input->post('jumlah['.$key.']').'||'.$this->input->post('dosis['.$key.']').'{}';
}
My problem now, i cant access to input->post('jumlah') and input->post('dosis') and when i echo $resep , It just display the value of input->post('obat'). I have try to directly write input->post('jumlah[1]') and it cant still display the value when i submit it.
Please help me ...