I am developing an MVC application with Zend Framework and jQuery. My Model consists of three layers: Service Layer, Mapper, Domain Model.
To date I have been struggling with input validation - some happens on the client, some in the Zend Form, and some in the domain model. The responsibilities have become confusing and there is lots of duplicated logic.
After giving it some thought, I can't see any reason why I wouldn't skip doing any Zend Form validation. I can validate simple things (including regex) using javascript, and get additional data from the server when required (via ajax). When the form passes validation, I'll pass it through to the server.
Of course my domain model logic will need to be comprehensive (duplicating all that's on the client), but what else is a domain model for, right?
Am I missing anything? Are there any gotchas to watch out for?
EDIT: Just to be clear, I am not suggesting abandoning server side validation at all. (I realise that this is imperative.) I am suggesting that if my domain model does it, there is no need to do it in the form as well.