• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED]multi level chained using tank auth

#1
[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>
   &lt;?php
    $dropdown = array(
     ''=>'Pilih Provinsi'
    );
    foreach ($provinsis as $key => $test){
     $dropdown[$key] = $test;
    }
   ?&gt;
   &lt;?php echo form_dropdown('provinsi',$dropdown,$this->input->post('provinsi'),'id="provinsi"'); ?&gt;
  </td>
  <td>
   &lt;?php
    $kota = array(
     '' => 'Pilih Kota/Kab'
    );
   ?&gt;
   &lt;?php echo form_dropdown('kota',$kota,$this->input->post('kota'),'id="kota"'); ?&gt;
  </td>
</tr>
    <tr>
  <td>
   &lt;?php
    $kec = array(
     '' => 'Pilih Kecamatan'
    );
   ?&gt;
   &lt;?php echo form_dropdown('kecamatan',$kec,$this->input->post('kecamatan'),'id="kec"'); ?&gt;
  </td>
  <td>&lt;?php echo form_input($kodepos); ?&gt;</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

#2
[eluser]ranggadablues[/eluser]
Someone help me please..

thank you

#3
[eluser]ranggadablues[/eluser]
never mind I already solved my problem, thank you for all your attention ;-)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.