Welcome Guest, Not a member yet? Register   Sign In
Problem with form validation
#11

[eluser]Aniket Pant[/eluser]
Did that too. All my rules are in a config file. It still isn't working.

Used this too
Code:
$this->output->enable_profiler(TRUE);

All the values are being posted. Still no progress.
#12

[eluser]Aken[/eluser]
Post your updated controller code.
#13

[eluser]Aniket Pant[/eluser]
Code:
$data['page_title'] = 'Create Profile (Step 2)';

                $loginid = $this->session->userdata('loginid');

                $this->load->model('profilemodel', 'profile');
                $userid = $this->profile->get_userid($loginid);

                $this->session->set_userdata('userid', $userid);

                $usertype = $this->profile->get_usertype($userid);
                $data['usertype'] = $usertype;

                if ($usertype == 'User') {
                    $this->load->model('activitymodel', 'activity');
                    $arr_activities = $this->activity->get_activities();
                    $data['options'] = $arr_activities;
                }
                else if ($usertype == 'Gym/Health Club Owner') {
                    $this->load->model('facilitymodel', 'facility');
                    $arr_facility = $this->facility->get_facilities();
                    $data['options'] = $arr_facility;
                }
                
                $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
                $this->output->enable_profiler(TRUE);
                
                if ($usertype == 'User') {
                    if ($this->form_validation->run('User') == FALSE) {
                        $this->load->view('create-profile-step-2', $data);
                    }
                    else {
                        $selected_options = $this->input->post('activities');
                        $this->activity->add_user_activities($userid, $selected_options);
                        $sex = $this->input->post('sex');
                        $this->profile->add_user_details($userid, $sex);
                        echo 'Profile Creation Completed!';
                    }
                }
                else {
                    if ($this->form_validation->run('Gym/Health Club Owner') == FALSE) {
                        $this->load->view('create-profile-step-2', $data);
                    }
                    else {
                        $selected_options = $this->input->post('facilities');
                        $this->facility->add_gym_facility($userid, $selected_options);
                        $website = $this->input->post('website');
                        $hours_of_operation = $this->input->post('hours_of_operation');
                        $membership_charges = $this->input->post('membership_charges');
                        $this->facility->add_gym_details($userid, $website, $hours_of_operation, $membership_charges);
                        echo 'Profile Creation Completed!';
                    }
                }
#14

[eluser]Wondering Coder[/eluser]
which of the two validation is running/ok? the user or the Gym/Health Club Owner validation?
#15

[eluser]Aniket Pant[/eluser]
None of them is running properly :|

All other validations in my site are running fine except for these two.
#16

[eluser]Wondering Coder[/eluser]
ok, just to pin down what's wrong. Why don't you try using only user and test some data in it. Also I don't think the config file handles spaces/ ''. Instead of whitespaces use underscore or something. A lot of weird error happen in whitespaces and use small case.

By the way those running validation that's okay are they you're work?
#17

[eluser]Aniket Pant[/eluser]
[quote author="Wondering Coder" date="1313061224"]ok, just to pin down what's wrong. Why don't you try using only user and test some data in it. Also I don't think the config file handles spaces/ ''. Instead of whitespaces use underscore or something. A lot of weird error happen in whitespaces and use small case.

By the way those running validation that's okay are they you're work?[/quote]

Tried that too. Not working. Removed the whitespaces too. No change.
Also, the validation is not working with User too. :\




Theme © iAndrew 2016 - Forum software by © MyBB