Welcome Guest, Not a member yet? Register   Sign In
I need your way of doing form validation
#2

[eluser]psychoder[/eluser]
you can pass your result to view and do the actions...


Code:
if($this->input->post('submitted') =='yes') { // this is hidden field in the form
    
if($this->form_validation->run() === TRUE) {
  $ovca = array('success'=>TRUE,'messages'=>'Your post has been submitted!');

  $this->admin_model->update_duela($duel_id);
} else {
  $ovca = array('success'=>FALSE,'messages'=>validation_errors());
}
  $this->load->view('your_view_file',$ovca);
}


then in your view... do it like this...

Code:
echo $message;

// or you can check the success before displaying the message...

if($success == TRUE)
{
//DO SOMETHING
}
else
{
  //DO SOMETHING
}


Messages In This Thread
I need your way of doing form validation - by El Forum - 07-01-2012, 05:16 PM
I need your way of doing form validation - by El Forum - 07-01-2012, 07:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB