I'm working on a Pylons-based web app. Because I am sane, I am using jQuery (and plugins) instead of writing raw JavaScript. I am also using FormEncode to validate forms for my app (especially new user registration). FormEncode is great for validating forms after they're submitted. jQuery, when JavaScript is available, validates forms quite well before they're submitted.
I'm greedy: I want to use both kinds of validation - and I don't want to repeat myself. If there are two sets of validation rules, there's an extra workload generated by keeping them in sync.
How can I use jQuery to access my FormEncode validation rules, so that both jQuery and FormEncode investigate form data based on the same rules without having to write the rules down twice ?