EllisLab/CodeIgniter — Issue #1129: Form_validation invalid checking
Author: aanbar
Created: 2012-03-05 15:01:01+00:00
State: open

Form_validation Currently checking posted variables only.

Example:
view.php
<input type="text" name="txt" />

if I set the validation rules for this field in the controller
Something.php
function index() {
$this->form_validation->set_rules('txt', 'Text', 'trim|required');
if ( $this->form_validation->run() == false ) {
echo validation_errors();
}else{
echo "form has passed checks";
}
}

if I call my script http://127.0.0.1/something , I should be getting errors from validation ... but that's not the case as it is checking if variables are posted or not
then it will return false without any errors so I end up with empty page.

It should be noted though this makes some of the tests useless like (required, isset).

My thought: form_validation should be checking based on rules not the posted variables.