Really Simple Validation (RSV)

联合创作 · 2023-10-02 14:34

This small but powerful script lets you add javascript validation to your forms quickly and with very little effort. No programming experience is necessary, but it's fully extensible to allow programmers to augment the built-in validation rules with their own.

RSV comes in three flavours: as a standalone script, as a jQuery plugin and as a Prototype extension. All of the versions offer the same functionality, but I've separated the documentation and examples into sections to keep things clear. If you're unfamiliar with jQuery or Prototype you'll probably want to use the standalone script.

The script offers all the common validation routines offered by other validation scripts, but more importantly it supports "fringe" cases very well, with features such as:

  • It allows you to apply multiple validation rules to the same field
  • Allows for simple conditional logic (if field A == something, validation fields B, C and D)
  • You can make up your own validation rules
  • you can display the errors in literally any way you want, with 3 built-in standard ways to present them and the option to pass the errors to a custom error handler
  • Lets you pass off control flow to your own onCompleteHandler function
  • there's a PHP sister script available. You can literally copy & paste your validation rules to a PHP file to get server-side validation.
浏览 9
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报