Using jQuery and FormEncode to validate forms without repeating

I am working on a Pylons based web application. Since I am sound, I use jQuery (and plugins) instead of writing raw JavaScript. I also use FormEncode to validate forms for my application (especially for new user registrations). FormEncode is great for validating forms after they are submitted. jQuery, when JavaScript is available, validates forms well enough before they are submitted.

I am greedy: I ​​want to use both types of verification - and I do not want to repeat it myself. If there are two sets of validation rules, there is an additional workload generated when they are synchronized.

How can I use jQuery to access my FormEncode validation rules so that both jQuery and FormEncode can examine form data based on the same rules without writing these rules twice?

+3
source share
1 answer

, FormEncode , , , , AJAX, FormEncode, , jQuery AJAX-y , , .

+2

Source: https://habr.com/ru/post/1766087/


All Articles