{"id":676,"date":"2021-09-06T01:46:14","date_gmt":"2021-09-05T16:46:14","guid":{"rendered":"https:\/\/memo.baseline-lib.com\/?p=676"},"modified":"2022-02-03T07:49:24","modified_gmt":"2022-02-02T22:49:24","slug":"jquery-%e3%83%95%e3%82%a9%e3%83%bc%e3%83%a0%e3%83%90%e3%83%aa%e3%83%87%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e5%ae%9f%e8%a3%85%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/memo.baseline-lib.com\/?p=676","title":{"rendered":"jQuery \u30d5\u30a9\u30fc\u30e0\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u5b9f\u88c5\u65b9\u6cd5"},"content":{"rendered":"<h2>\u30d5\u30a9\u30fc\u30e0\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092jQuery\u3067\u884c\u3046\u65b9\u6cd5<\/h2>\n<p>\u3069\u3046\u3057\u3066\u3082php\u306a\u3069\u3067\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u3067\u304d\u306a\u3044\u6642\u306a\u3069\u306bjs\u3084jQuery\u3067\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u884c\u3046\u65b9\u6cd5\u3067\u3059\u3002<br \/>\njQuery\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u4f7f\u7528\u306e\u5834\u5408\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u4ee5\u4e0b\u306e\u30d5\u30a9\u30fc\u30e0\u306e\u5834\u5408\u306e\u8a18\u8ff0\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;form action=&quot;..\/contact&quot; method=&quot;post&quot;&gt;\r\n    &lt;table&gt;\r\n        &lt;tbody&gt;\r\n        &lt;tr&gt;\r\n                &lt;th scope=&quot;row&quot;&gt;\u540d\u524d \u203b\u5fc5\u9808&lt;\/th&gt;\r\n                &lt;div class=&quot;data-name&quot;&gt;&lt;\/div&gt;\r\n                &lt;td&gt;&lt;input type=&quot;text&quot; data=&quot;name&quot; name=&quot;p_order[NAME]&quot; value=&quot;&quot;&gt;&lt;\/td&gt;\r\n            &lt;\/tr&gt;\r\n            &lt;tr&gt;\r\n                &lt;th scope=&quot;row&quot;&gt;mail\u203b\u5fc5\u9808&lt;\/th&gt;\r\n                &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;p_order[NAME]&quot; value=&quot;&quot;&gt;&lt;\/td&gt;\r\n            &lt;\/tr&gt;\r\n            &lt;tr&gt;\r\n                &lt;th scope=&quot;row&quot;&gt;\u6027\u5225&lt;\/th&gt;\r\n                &lt;td&gt;\r\n                &lt;label for=&quot;&quot;&gt;\r\n                        &lt;input type=&quot;radio&quot; name=&quot;p_order[sex]&quot; value=&quot;&quot;&gt;\r\n                        \u7537\u6027\r\n                    &lt;\/label&gt;\r\n                    &lt;label for=&quot;&quot;&gt;\r\n                        &lt;input type=&quot;radio&quot; name=&quot;p_order[sex]&quot; value=&quot;&quot;&gt;\r\n                        \u5973\u6027\r\n                    &lt;\/label&gt;\r\n                &lt;\/td&gt;\r\n            &lt;\/tr&gt;\r\n            &lt;tr&gt;\r\n                &lt;th scope=&quot;row&quot;&gt;\u304a\u554f\u3044\u5408\u308f\u305b\u5185\u5bb9\u3000\u203b\u5fc5\u9808&lt;\/th&gt;\r\n                &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;p_order[comment]&quot; value=&quot;&quot;&gt;&lt;\/td&gt;\r\n            &lt;\/tr&gt;\r\n            &lt;tr&gt;\r\n                &lt;td&gt;&lt;input type=&quot;submit&quot; value=&quot;\u78ba\u8a8d&quot; class=&quot;&quot;&gt;\u78ba\u8a8d&lt;\/td&gt;\r\n            &lt;\/tr&gt;\r\n        &lt;\/tbody&gt;\r\n    &lt;\/table&gt;\r\n&lt;\/form&gt;\r\n<\/pre>\n<p>\u57fa\u672c\u7684\u306b\u30a8\u30e9\u30fc\u7b87\u6240\u306einput\u30bf\u30b0\u306b\u5fc5\u9808\u9805\u76ee\u306e\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u307e\u3059\u304c\u3001<br \/>\n\u4e0b\u8a18\u306e\u300cerrorPlacement\u300d\u306f\u4efb\u610f\u306e\u7b87\u6240\u306b\u30a8\u30e9\u30fc\u5185\u5bb9\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u4ee5\u4e0b\u306einput\u30bf\u30b0\u306b\u300cdata=&#8221;name&#8221;\u300d\u3068\u8a18\u8ff0\u3092\u3057\u3066\u3044\u305f\u3089\u4e0a\u90e8div\u30bf\u30b0\u306e\u300cid=&#8221;data-name&#8221;\u300d\u306e\u30bf\u30b0\u306b\u5fc5\u9808\u9805\u76ee\u306e\u5185\u5bb9\u3092\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;div id=&quot;data-name&quot;&gt;&lt;\/div&gt;\r\n&lt;input type=&quot;text&quot; data=&quot;name&quot; name=&quot;p_order[NAME]&quot; value=&quot;&quot;&gt;\r\n<\/pre>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;script src=&quot;https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery-validate\/1.19.0\/jquery.validate.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script src=&quot;https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery-validate\/1.19.0\/localization\/messages_ja.min.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\n$('form').validate({\r\n    \/\/ Validation\u30eb\u30fc\u30eb\r\n    rules: {\r\n        \/\/ name\u5c5e\u6027\u3067required true\u3067\u5fc5\u9808\u9805\u76ee\u8a2d\u5b9a\r\n        'p_order[COLOR]': {\r\n          required: true, \r\n        },\r\n        'p_order[SIZE]': {\r\n          required: true, \r\n        },\r\n        'p_order[DESIGN]': {\r\n          required: true, \r\n        },\r\n        'p_order[LAYOUT]': {\r\n          required: true, \r\n        },\r\n\r\n    },\r\n \r\n    \/\/ \u6307\u5b9a\u3057\u305f\u5c5e\u6027\u306b\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002\r\n    messages: {\r\n        'p_order[COLOR]': {\r\n            required: '\u5fc5\u9808\u9805\u76ee\u3067\u3059',\r\n        },\r\n        'p_order[SIZE]': {\r\n            required: '\u5fc5\u9808\u9805\u76ee\u3067\u3059',\r\n        },\r\n        'p_order[DESIGN]': {\r\n            required: '\u5fc5\u9808\u9805\u76ee\u3067\u3059',\r\n        },\r\n        'p_order[LAYOUT]': {\r\n            required: '\u5fc5\u9808\u9805\u76ee\u3067\u3059',\r\n        },\r\n    },\r\n\terrorElement: 'span',\r\n\t\/\/ errorClass:'error',\r\n    \/\/ \u4efb\u610f\u306e\u5834\u6240\u306b\u30a8\u30e9\u30fc\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u308b\r\n\terrorPlacement: function(error, element){\r\n\t\tvar name = element.attr('data');\r\n\t\terror.appendTo($('#data-'+name));\r\n\t}\r\n\r\n});\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3084\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306e\u5834\u5408\u306f\u3069\u3046\u3057\u3066\u3082\u4efb\u610f\u306e\u5834\u6240\u306b\u8868\u793a\u3055\u305b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u30b1\u30fc\u30b9\u304c\u3067\u304d\u308b\u306e\u3067\u304a\u305d\u3089\u304f\u3053\u306e\u95a2\u6570\u3092\u591a\u7528\u3059\u308b\u3053\u3068\u304c\u591a\u304f\u306a\u308b\u3088\u3046\u306b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/www.fenet.jp\/dotnet\/column\/tool\/6662\/#Validation\">\u53c2\u8003\u30b5\u30a4\u30c8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30d5\u30a9\u30fc\u30e0\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092jQ&hellip;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[14,15],"_links":{"self":[{"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=\/wp\/v2\/posts\/676"}],"collection":[{"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=676"}],"version-history":[{"count":4,"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=\/wp\/v2\/posts\/676\/revisions"}],"predecessor-version":[{"id":682,"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=\/wp\/v2\/posts\/676\/revisions\/682"}],"wp:attachment":[{"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/memo.baseline-lib.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}