// the find
sofish/validator.js
一个简单、轻量级,但功能强大的 Validator 组件
A jQuery/Zepto form validation plugin from around 2014 that hooks into HTML5 form attributes (required, pattern, min/max, type) to drive validation logic. It targets projects already running jQuery or Zepto that want declarative validation without writing their own blur handlers. The README is in Chinese.
Async validation via data-url is a genuinely useful feature that most lightweight validators skip. The pattern attribute taking precedence over type keeps it consistent with native HTML5 behavior. The a-or-b mutual-exclusion field pairing (data-aorb) solves a real form problem that most validators ignore. Zero configuration path — just add required attributes and call .validator() — is fast to drop in.
Last commit is 2019, jQuery/Zepto dependency is a hard requirement with no standalone build, and the ecosystem has moved well past this pattern. No TypeScript types, no npm package with a modern export, and test coverage is two HTML files you open manually. The async validation makes raw AJAX calls with no CSRF handling, which is a security gap anyone integrating it in a form with sensitive data would have to solve themselves. 281 stars after years of existence suggests it never got wide adoption outside the author's own projects.