CodeIgniter Forums
Don't know how to word this question. Sorry - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Don't know how to word this question. Sorry (/showthread.php?tid=40907)



Don't know how to word this question. Sorry - El Forum - 04-22-2011

[eluser]jj.n.ford[/eluser]
Okay I want to load something onto a view just like form validations errors load. For instance I have a page with a form that the user submits. I would like to then display that same form with more content below it. I can create custom form validations to do this but is there a better way.

Also is there a good way have a method in a controller determine what it should do base on what was last posted. This would create a streamlined process. In my case I am building a password reset function. After the user gives an ID they press continue and will be asked the answer a security question. But I don't want to load this security question with a different method otherwise a user could access this method through the URL without giving any ID.

Any help would be appreciated. I just started with CI this week. I must say I LOVE it!


Don't know how to word this question. Sorry - El Forum - 04-22-2011

[eluser]pickupman[/eluser]
Congrats on finding CI, and welcome to the forums. You can create multiple if statements for your form validation rules.
Code:
$this->form_validation->set_rules('userID', 'user id', 'required|trim');
if(isset($this->input->post('userID'))
   $this->form_validation->set_rules('security_question1', 'security question', 'required|trim');

if($this->form_validation->run()){
  //Process reset password
}



Don't know how to word this question. Sorry - El Forum - 04-22-2011

[eluser]jj.n.ford[/eluser]
Cool thanks. That was the method I was using but wasn't sure if there was a better way! Good deal. Thanks.