• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form Validation

I have a form on an index page (controllername/)

That form does a POST to controllername/create

The form validation is in the index method of the controllername class.

When the form is submitted, the validation doesn't happen.

What am I doing wrong?

CI performs form validation when the form input has been posted.
So move your form validation to the create method.

A better way is to keep the code for displaying the form and performing the form validation within one method.
As described in the documentation:

Thank you.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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