[eluser]ranggadablues[/eluser]
Hi there..
I have some project and I use tank auth login form for my login page, and inside of tank auth registration form I added more some field that one of them I used form_dropdown with 3 multiple level and of course using jquery also, oh here is the code
my views
Code:
... //some text code
<tr>
<td>
<?php
$dropdown = array(
''=>'Pilih Provinsi'
);
foreach ($provinsis as $key => $test){
$dropdown[$key] = $test;
}
?>
<?php echo form_dropdown('provinsi',$dropdown,$this->input->post('provinsi'),'id="provinsi"'); ?>
</td>
<td>
<?php
$kota = array(
'' => 'Pilih Kota/Kab'
);
?>
<?php echo form_dropdown('kota',$kota,$this->input->post('kota'),'id="kota"'); ?>
</td>
</tr>
<tr>
<td>
<?php
$kec = array(
'' => 'Pilih Kecamatan'
);
?>
<?php echo form_dropdown('kecamatan',$kec,$this->input->post('kecamatan'),'id="kec"'); ?>
</td>
<td><?php echo form_input($kodepos); ?></td>
</tr>
... //some text code
jQuery(function($) {
$('#provinsi').autoPopulateBox({
emptyLabel: 'Pilih',
url: 'http://localhost/myshop/myshop/json/',
allSeparator: '/',
change: 'kota',
kota: {
target: '#kota',
change: 'kecamatan'
},
kecamatan: {
target: '#kec'
}
});
});
my auth Controller
Code:
... //some text code
if ($this->form_validation->run()) { // validation ok
if (!is_null($data = $this->tank_auth->create_user(
$use_username ? $this->form_validation->set_value('username') : '',
$this->form_validation->set_value('email'),
$this->form_validation->set_value('password'),
$this->form_validation->set_value('nama_depan'),
$this->form_validation->set_value('nama_belakang'),
$this->form_validation->set_value('alamat'),
$this->form_validation->set_value('kodepos'),
$this->form_validation->set_value('tlp_rumah'),
$this->form_validation->set_value('hp'),
$this->form_validation->set_value('provinsi'),
$this->form_validation->set_value('kota'),
$this->form_validation->set_value('kecamatan'),
$email_activation))) {
... //some text code
my users model
Code:
... //some text code
private function create_profile($user_id)
{
$this->db->set('user_id', $user_id);
$data = array(
'nama_depan' => $this->input->post('nama_depan'),
'nama_belakang' => $this->input->post('nama_belakang'),
'alamat' => $this->input->post('alamat'),
'kodepos' => $this->input->post('kodepos'),
'tlp_rumah' => $this->input->post('tlp_rumah'),
'hp' => $this->input->post('hp'),
'provinsi' => $this->input->post('provinsi'),
'kota' => $this->input->post('kota'),
'kecamatan' => $this->input->post('kecamatan')
);
return $this->db->insert($this->profile_table_name, $data);
}
... //some text code
My question is, when click submit it show some error 'Your code confirmation has expired. Please try again', but when I open source code in the browser, there does not appear the value of the dropdown options. So how I can insert all field to database?
thank you