Form Validation, validation->error_string not displaying |
[eluser]freakish777[/eluser]
So following the instructions here, when I don't fill out the form correctly I don't see the error string above my re-loaded form. However when I switch: Code: if ($this->validation->run() == FALSE) to: Code: if ($this->validation->run() == FALSE) I do in fact see the error string. Has anyone else experienced something similar? Is there some type of scope issue on the variables? I would imagine once they're set they'd be accessible in any of the views you load them in later...
[eluser]JayTee[/eluser]
Now that there's a new version of CI out, you'll probably want to indicate which one you're using.
[eluser]JayTee[/eluser]
I don't know if it's a bug that was resolved, per se; the form validation has been re-done in 1.7.0. You may want to check it out. On the other hand, I would suggest that you avoid checking for falsehood; it's not the best programming practice if you can avoid it. I usually do it this way: Code: if ($this->validation->run()) Anyway, the reloaded form should have this in it: Code: <?PHP echo $this->validation->error_string ?>
[eluser]freakish777[/eluser]
[quote author="JayTee" date="1225094693"]I would suggest that you avoid checking for falsehood[/quote] Can $this->validation->run() resolve to anything besides true or false (I assume it can't)? If not then it's largely inconsequential whether I check for true or false, and it doesn't affect readability at all (for me at least,I'm the only one maintaining the code for the site in question). Quote:Anyway, the reloaded form should have this in it: It does, just like the example I linked to in my first post. That's why I'm confused as to why I'm not seeing anything. I'll see if CI 1.7.0 helps.
|
Welcome Guest, Not a member yet? Register Sign In |