[eluser]123wesweat[/eluser]
Need to take a break,but maybe someone sees it
Code:
function education($action = '')
{
if ( ! $this->dx_auth->is_logged_in())
{
echo ' 404';
} else {
$this->load->helper(array('form', 'url'));
$this->load->helper('my_form');
$this->load->library("form_validation");
$this->load->model('dx_auth/user_profile');
$this->load->model('dx_auth/user_profile_features');
if($action != '') {
//get some user profile data
$data['user_name'] = $this->dx_auth->get_username('username');
$user_id = $this->dx_auth->get_user_id('username');
$arrEmail=$this->_get_email($user_id);
$data['email'] = $arrEmail->email;
$user_profile_data = $this->user_profile->get_profile($user_id)->result();
switch ($action) {
case "edit":
$val = $this->form_validation;
$val->set_rules('name', 'name', 'trim|required|xxs_clean');
...rest of rules
$val->set_message('required', '%s forgot');
$this->form_validation->set_error_delimiters('', '<br/>');
if ($val->run() == FALSE) {
$data['auth_message'] = 'following errors';
$this->load->view('authFS/education_form', $data);
} else {
}
//get education and update
$user_profile_features_data = $this->user_profile_features->get_profile_feature_opleiding($user_id)->result();
$data['profile_data'] = $user_profile_features_data[0];
//pre select education
$preselectEducation = $data['profile_data']->opleidingNaam;
$data['profile_data']->opleiding_dropdown = $this->user_profile_features->get_education_dropdown2($preselectEducation);
break;
case "add":
new education
break;
case "delete":
delete education
break;
}
$this->load->view('authFS/education_form', $data);
}
}//.end $action
}
I am tryin to use authFS/education/edit
to show a form
and
onsubmit it should handle the validation and update the db.
Calling authFS/education/edit triggers ($val->run() == FALSE). how can i prevent this??