• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Don't know how to word this question. Sorry

#1
[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!

#2
[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
}

#3
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.