I am programming a site with the CODE IGNITER framework and a view has a tab-pane. By entering the information to the form and reloading the view, I am in the first tab and I need to be able to handle that
Any suggestions or ideas?
This is the code of the view
<ul class="nav nav-tabs">
<li class="active">
<a href="#a" data-toggle="tab">Correo</a>
</li>
<li>
<a href="#b" data-toggle="tab">Usuarios</a>
</li>
<li>
<a href="#c" data-toggle="tab">Clientes</a>
</li>
<li>
<a href="#d" data-toggle="tab">Embarques</a>
</li>
</ul>
...
<div class="tab-pane active" id="b">
<form class="form-group">
...
</form>
</div>
Then in my controller I have
public function nuevoUsuario(){
$this->form_validation->set_error_delimiters('<div class="error">', '</div>');
$this->form_validation->set_rules('correoUser', 'Correo', 'required|valid_email');
$this->form_validation->set_rules('nUsuario', 'Nombre Usuario', 'required|min_length[5]|max_length[50]');
if ($this->form_validation->run() == FALSE) {
$data['message'] = validation_errors();
$this->load->view('Configuracion/config_view',$data);
}
else {
$data = array(
'usuario' => $this->input->post('correoUser'),
'nombre' => $this->input->post('nUsuario'),
'password' => $this->input->post('passUser'),
'id_perfil' => $this->input->post('perfil')
);
$this->Config_model->insertUser($data);
$data['message'] = 'Datos Ingresados con Exito';
$this->load->view('Configuracion/config_view', $data);
}
}
I would like that when loading the view, it remains in tab #b but I do not know how to handle that event