I have create a small and flexible library for doing form flexible validation without writing much (with luck any JS). It's based on idea I had implemented in my past work, and it worked quite neatly IMO. Instead of binding constraints to fields, we instead "bind them to messages", this means constrains are not restricted to "span" single field, as well as allowing more flexibility in placement and styling. Also && of constraints flows naturally from implementation, thus you have more complex constraints just by nesting your html tags.