Welcome Guest, Not a member yet? Register   Sign In
Form validation with redirect
#5

(10-26-2015, 07:44 AM)Martin7483 Wrote: Your home and send method are in the same controller. Add your validation check to your home method. When valid you can then pass it to your send method for processing. Doing this your post url can be /home#anchor

Thanks so much for you help. However I'm afraid you've lost me with the last advice. Clicking send in the form page currently directs me to the send method in the controller. Are you suggesting that instead it should go to the home method where the validation rules are then set and then conditionally either the home page is reloaded with validation errors or it is passed to the send method?

My home method is currently this:

Code:
        $this->data['body_id'] = 'home';
        $this->data['main'] = 'pages/home_view';    
        $this->load->view('templates/template_main_view', $this->data);
I have already tried changing it to:

Code:
        $this->data['body_id'] = 'home';
        $this->data['main'] = 'pages/home_view#anchor';    
        $this->load->view('templates/template_main_view', $this->data);
but I get the not found error because it's trying to reach a page .../home#anchor.php which obviously doesn't eist
Reply


Messages In This Thread
Form validation with redirect - by msheath - 10-26-2015, 04:42 AM
RE: Form validation with redirect - by Martin7483 - 10-26-2015, 05:34 AM
RE: Form validation with redirect - by msheath - 10-26-2015, 07:26 AM
RE: Form validation with redirect - by Martin7483 - 10-26-2015, 07:44 AM
RE: Form validation with redirect - by msheath - 10-26-2015, 08:09 AM
RE: Form validation with redirect - by msheath - 10-28-2015, 02:39 AM
RE: Form validation with redirect - by Narf - 10-27-2015, 03:42 AM
RE: Form validation with redirect - by msheath - 10-28-2015, 02:54 AM
RE: Form validation with redirect - by Narf - 10-28-2015, 04:21 AM
RE: Form validation with redirect - by msheath - 10-28-2015, 04:50 AM
RE: Form validation with redirect - by Martin7483 - 10-27-2015, 12:16 PM
RE: Form validation with redirect - by msheath - 10-28-2015, 02:15 AM
RE: Form validation with redirect - by mwhitney - 10-27-2015, 12:29 PM
RE: Form validation with redirect - by Martin7483 - 10-28-2015, 02:41 AM
RE: Form validation with redirect - by Martin7483 - 10-28-2015, 05:00 AM
RE: Form validation with redirect - by msheath - 10-28-2015, 05:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB