Welcome Guest, Not a member yet? Register   Sign In
view receives different parameters before and after sending the form.
#1

[eluser]Alejandrito[/eluser]
For some unknown reason (to me), when I load the page the view gets all the correct parameters, no errors, but when I send the form, I get a lot of errors that shouldn't be there (duh!) and I don't know why.

In both cases, the data "should" be the same (as far as I know).

Maybe you can give just a hint on where my error is?

Thanks!

This is my controller:
Code:
$this->form_validation->set_rules($reglas_validacion);
  $this->form_validation->set_error_delimiters('<br /><span><i class="icon-fire"></i>', '</span>');
  
  
   $datos['ingresos']  = $this->mod_ingresos->todos();
   $datos['igvpagado']  = $this->mod_gastos->igv();
   $datos['igvrecibido'] = $this->mod_ingresos->igv();
  
  // Si no pasa la validaciĆ³n de datos:
  // echo var_dump($datos);
  if ($this->form_validation->run() == FALSE)
  {  
   $this->load->view('ingresos_view', $datos);
  }
  else
  {
   // llenamos los datos para mandar al model
   $datos = array(
       'fecha'   => set_value('fecha')   ,
       'tipodocumento' => set_value('tipodocumento') ,
       'serie'   => set_value('serie')   ,
       'documento'  => set_value('documento')  ,
       'tipoingreso' => set_value('tipoingreso')  ,
       'cliente'  => set_value('cliente')   ,
       'descripcion' => set_value('descripcion')  ,
       'precio'  => set_value('precio')
       );
   // echo "<p>var_dump(datos)" . var_dump($datos). "</p>";
   if($this->input->post('submit'))
   {
                $this->mod_ingresos->agregar($datos);
                $this->load->view('ingresos_view', $datos);
            }
         }
and this is my view:

view file
#2

[eluser]Alejandrito[/eluser]
for those you want to know, I solved this by using FormIgniter so I avoided any simple error I could have (actually I had).

Anyways, thanks.




Theme © iAndrew 2016 - Forum software by © MyBB