Form Validation alpha_numeric spaces!!! |
[eluser]tjrede[/eluser]
Does Form Validation not allow alpha_numeric_spaces!!!???
[eluser]LuckyFella73[/eluser]
Spaces are not alphanumeric. The CI form_validation library provides the basic validations. If the rule you need is not available you can set up a callback function that validates like you need it.
[eluser]tjrede[/eluser]
I tried replacing my alpha_numeric function in the form validation class with - return ( ! preg_match(" /^[A-Za-z0-9\s]+$/i", $str)) ? FALSE : TRUE; But didn't work
[eluser]CroNiX[/eluser]
Why would you replace a rule when you can extend form validation with your own custom rules, or use a callback function? You shouldn't have to modify core CI files, which can lead to upgrade problems down the line. You extend the core so you don't have to touch the original files. http://ellislab.com/codeigniter/user-gui...asses.html |
Welcome Guest, Not a member yet? Register Sign In |