PageSourceSearch

https://chusonji.or.jp/common/js/vendor/form/exchecker-ja.js

js chusonji.or.jp collected 2026-09-24 09:22:21 UTC 4,905 bytes, 169 lines download raw bytes

1/*!
2 * exchecker-ja
3 *
4 * @version   : 1.1
5 * @author    : nori ([email protected])
6 * @copyright : 5509 (http://5509.me/)
7 * @license   : The MIT License
8 * @link      : http://5509.me/log/exvalidation
9 * @modified  : 2012-04-09 16:52
10 */
11;(function($) {
12  // Extend validation rules
13  $.exValidationRules = $.extend($.exValidationRules, {
14    chkrequired: [
15      "入力してください",
16      function(txt, t) {
17        if ( $(t).hasClass("chkgroup") ) {
18          var flag = 0;
19          $("input,select",t).each(function() {
20            if ( $(this).val().length > 0 ) flag++;
21          });
22          if ( txt && flag === $("input,select", t).length ) {
23            if ( /^[  \r\n\t]+$/.test(txt) ) {
24              return false;
25            } else {
26              return true;
27            }
28          }
29        } else {
30          if ( txt && txt.length>0 ) {
31            if ( /^[  \r\n\t]+$/.test(txt) ) {
32              return false;
33            } else {
34              return true;
35            }
36          }
37        }
38      }
39    ],
40    chkselect: [
41      "選択してください",
42      function(txt, t) {
43        if ( txt && txt.length>0 ) {
44          if ( /^[  \r\n\t]+$/.test(txt) ) {
45            return false;
46          } else {
47            return true;
48          }
49        }
50      }
51    ],
52    chkretype: [
53      "入力内容が異なります",
54      function(txt, t) {
55        var elm = $("#" + $(t).attr("class").split("retype\-")[1].split(/\b/)[0]);
56        if ( elm.hasClass("chkgroup") ) {
57          var chktxt = $("input", elm), txt = $("input", t);
58          for ( var i = 0, flag = false; i < chktxt.length; i++ ) {
59            if ( chktxt[i].value === txt[i].value ) {
60              flag = true;
61            } else {
62              flag = false;
63              break;
64            }
65          }
66          if ( flag ) return true;
67        } else {
68          return elm.val() == txt;
69        }
70      }
71    ],
72    chkemail: [
73      "正しいメールアドレスの形式を入力してください",
74      /^(?:[^\@]+?@[A-Za-z0-9_\.\-]+\.+[A-Za-z\.\-\_]+)*$/
75    ],
76    chkhankaku: [
77      "全角文字は使用できません",
78      /^(?:[a-zA-Z0-9@\<\>\;\:\[\]\{\}\|\^\=\/\!\*\`\"\#\$\+\%\&\'\(\)\,\.\-\_\?\\\s]*)*$/
79    ], //"
80    chkzenkaku: [
81      "全角文字で入力してください",
82      /^(?:[^a-zA-Z0-9@\<\>\;\:\[\]\{\}\|\^\=\/\!\*\"\#\$\+\%\&\'\(\)\,\.\-\_\?\\\s]+)*$/
83    ],
84    chkhiragana: [
85      "ひらがなで入力してください",
86      /^(?:[ぁ-ゞ]+)*$/
87    ],
88    chkkatakana: [
89      "カタカナで入力してください",
90      /^(?:[ァ-ヾ]+)*$/
91    ],
92    chkfurigana: [
93      "ふりがなはひらがな、全角数字と〜、ー、()が利用できます",
94      /^(?:[ぁ-ゞ0-9ー~()\(\)\d  ]+)*$/
95    ],
96    chknochar: [
97      "英数字で入力してください",
98      /^(?:[a-zA-Z0-9]+)*$/
99    ],
100    chknocaps: [
101      "英数字(小文字のみ)で入力してください",
102      /^(?:[a-z0-9]+)*$/
103    ],
104    chknumonly: [
105      "半角数字のみで入力してください",
106      /^(?:[0-9]+)*$/
107    ],
108    chknumsymbol: [
109      "数字と::〜~のみ入力できます",
110      /^[0-90-9::~〜]+$/
111    ],
112    chkmin: [
113      "文字以上で入力してください",
114      function(txt, t) {
115        if ( txt.length === 0 ) return true;
116         var length = $(t).attr("class").match(/min(\d+)/) ? RegExp.$1 : null;
117        return txt.length >= length;
118      }
119    ],
120    chkmax: [
121      "文字以内で入力してください",
122      function(txt, t) {
123        var length = $(t).attr("class").match(/max(\d+)/) ? RegExp.$1 : null;
124        return txt.length <= length;
125      }
126    ],
127    chkradio: [
128      "選択してください",
129      function(txt, t) {
130        return $("input:checked",t).length>0;
131      }
132    ],
133    chkcheckbox: [
134      "上記に同意いただけない場合、i・マッチをご利用になれません",
135      function(txt, t) {
136        return $("input:checked",t).length>0;
137      }
138    ], 
139    chkzip: [
140      "正しい郵便番号の形式を入力してください",
141      /^(?:\d{3}-?\d{4}$|^\d{3}-?\d{2}$|^\d{3}$)*$/
142    ],
143    chkurl: [
144      "正しいURLの形式を入力してください",
145      /^(?:(?:ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)*$/
146    ],
147    chktel: [
148      "正しい電話番号を入力してください",
149      /^(?:\(?\d+\)?\-?\d+\-?\d+)*$/
150    ],
151    chkfax: [
152      "正しいファックス番号を入力してください",
153      /^(?:\(?\d+\)?\-?\d+\-?\d+)*$/
154    ],
155    chkfile: [
156      "ファイルを選択してください",
157      function(txt, t) {
158        if ( txt && txt.length>0 ) {
159          if ( /^[  \r\n\t]+$/.test(txt) ) {
160            return false;
161          } else {
162            return true;
163          }
164        }
165      }
166    ]
167  });
168})(jQuery);
169

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.