We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Is there a way to validate only some fields?

as I see, only the form itself can be validated. It validates if all fields passes, right? Well, this time I have to validate 3 fields - but those fields what passes, should go inside database. With the original schema, I cant do that

edited Dec '15

Hi Could you use the afterValidation(), i guess you could determine if the form has passed, if not, loop through each element to see which of them failed and then change these values to NULL or another default value. The form validation should be set to true, except the case were all fields are evaluated false. Hope this can lead you in some direction.