Welcome Guest, Not a member yet? Register   Sign In
Help with adding a jquery alert box after form is correctly submitted
#25

[eluser]noobs[/eluser]
yup...is working..besides insert data to my table...if i load my model in controller and i click data save...data still empty on my table...

-- controller --
Code:
function save_user()
{
$this->load->library('form_validation');
// this load form validation on cofig folder
if($this->form_validation->run('add_user') == FALSE)
{
            $array = '{ "message" : "Input not valid" }';
            echo $array;
}
else
{
$this->load->model('User_model');            
$add_data = $this->User_model->add_user();
if($add_data == TRUE)
{
       $array = '{ "message" : "Saving data success" }';
       echo $array;
}
else
{
       $array = '{ "message" : "Saving Failed" }';
       echo $array;
}
}
$this->load->view('add_user');
}

-- model --
Code:
function add_user()
{
$this->db->set('user_name',set_value('user_name'));
$this->db->insert('users');

return TRUE;
}


Messages In This Thread
Help with adding a jquery alert box after form is correctly submitted - by El Forum - 12-10-2010, 04:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB