Welcome Guest, Not a member yet? Register   Sign In
custom validation returns error always
#1

I have a custom validator that returns error always.

class myValidation extends CI_Form_validation {
/**
* myValidation::
*/

function fieldvalueisok($value){
//validates value against illegal entries such as "xxx"

$bannedValues=array('a','b','c');
if(in_array(strtolower($value),$bannedValues)){
return false;
}
return true;
}

}

Even if i return true everywhere, in a blank function etc, still i get an error from it. What am I missing? Please i wanna know more than the method above..the above is just an eg.
Reply
#2

What is the error you are getting - that would help...

Best wishes,

Paul.
Reply
#3

(12-13-2015, 01:56 PM)PaulD Wrote: What is the error you are getting - that would help...

Best wishes,

Paul.

Alo Paul...i get the error message set for in in my form validation language file. The form don't get submitted and validation_error() always always have an error message.
Reply
#4

(This post was last modified: 12-14-2015, 12:08 PM by CroNiX.)

This is not the proper way to extend native libraries. Notice what they name theirs. I don't think your extended class is even being loaded since it's named improperly.

https://codeigniter.com/user_guide/gener...-libraries
Reply
#5

MY_Form_validation {

}
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB