一番よさげなバリデータライブラリ「jQuery Inline Form Validation Engine」

| コメント(0) | トラックバック(0)

バリデータはサーバサイドよりも、クライアントサイドで完結していた方が、
ユーザビリティ的にも、開発者にとってもメリットが大きいと感じる(サーバ側でも対策するが)。
と言うことでバリデータのライブラリを探して、一番よさげなものに辿り着く。

「jQuery Inline Form Validation Engine」
これは、テキストフィールドだけではなく、radio,checkbox項目のチェックや
他の項目との比較、その他もろもろ・・・ほとんどすべてのチェック方法を指定可能。
該当項目へのツールチップ表示なども完璧。
ドキュメントは英語。

使い方:
ヘッダに下記を指定

<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" charset="utf-8" />
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript"></script>

フォームの項目にチェック方法指示
<input class="validate[required,custom[onlyLetter],length[0,100]]" name="firstname" type="text" />

チェック方法
optional: Special: Only validate when the field is not empty
required: Field is required
length[0,100] : Between x and x characters allowed
minCheckbox[7] : Set the maximum checkbox autorized for a group
confirm[fieldID] : Match the other field (ie:confirm password)
telephone : Match telephone regEx rule.
email : Match email regEx rule.
onlyNumber : Numbers only
noSpecialCaracters : No special characters allowed
onlyLetter : Letters only
date : Invalid date, must be in YYYY-MM-DD format

トラックバック(0)

トラックバックURL: http://www.someiyoshino.biz/mt/mt-tb.cgi/26

コメントする

Profile

Name:someiyoshino Home:Suginami Tokyo HP1:www.someiyoshino.biz HP2:www.seoby.biz Blog:www.someiyoshino.biz/blog Mail:info@someiyoshino.biz

2010年5月

            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

ウェブページ