Input validation return empty array |
I'm facing a weird issue trying to validate post input.
Following the userguide I set a controller to validate few POST input sent using a form. The controller is the following: Code: public function collection() In my view, using a print_r command, I get and empty array as 'validated' data...while 'errors' return the error if input are not valid. I really cannot understand what's wrong with $validData and why I get an empty array. Anny hint or help to figure out what's wrong? Thanks a lot for any help.
What? It work.
PHP Code: public function index(): string Code: array(5) {
Hi ozornick,
thanks a lot for taking time to check the code and for your feedback. It's really weird...since I cannot get the validated data...if I edit the code using the getPost() I can see the input POST data...[/url] You can see the working page at the following link: [url=https://aeclidb.it/census/collection]https://aeclidb.it/census/collection In the page ( a paginated gallery ) there are a couple of input field: a select and one autocomplete input text. A jQuery code submit the form as soon as selected a region or an item in the autocomplete list. I don't think that the issue could be related to the Javascript code.... Thanks a lot for any help EDIT: I just realized that in your code validated is: Code: ["validated"]=>
As long as there are errors, getValidated() remains empty.
PHP Code: array(5) {
Ah, now I see...thanks a lot for the invaluable help ozornick...I didn't realize that.
|
Welcome Guest, Not a member yet? Register Sign In |