I’m working with a kind of tabular input (user cannot add new items and each row is not a full model form). I’m following this guide http://www.yiiframework.com/wiki/666/handling-tabular-data-loading-and-validation-in-yii-2/ to achieve data validation (doing it yourself part), but I have a problem:
- When I submit the form, all fields go through validation and I just need to validate them if a row checkbox is cheked
How can I limit validation? Each row corresponds to a possible "Visit" model. In controller I create each Visit object and pass it to the view as an array of Visit objects. When I draw the form, I add a checkbox to each row. Form fields have names as [$i]datetime or [$i]commercial_agent_id.
Visit model has it’s own CRUD section that just works fine (this are Visit objects rapidly generated from another section of the admin…