{"id":1585,"date":"2018-11-13T21:27:54","date_gmt":"2018-11-13T12:27:54","guid":{"rendered":"http:\/\/4koma-web.com\/coding\/?p=1585"},"modified":"2018-11-13T21:30:19","modified_gmt":"2018-11-13T12:30:19","slug":"1585-2","status":"publish","type":"post","link":"https:\/\/4koma-web.com\/coding\/1585-2\/","title":{"rendered":"\u30d0\u30ea\u30c7\u30fc\u30c8\u4ed8\u304d\u306e\u6761\u4ef6\u5206\u5c90\u30d5\u30a9\u30fc\u30e0\u4f5c\u6210"},"content":{"rendered":"<p>mw wpform\u3067\u6761\u4ef6\u5206\u5c90\u30d5\u30a9\u30fc\u30e0\u3067\u3042\u308a\u306a\u304c\u3089\u3001\u305d\u308c\u305e\u308c\u306e\u30d5\u30a9\u30fc\u30e0\u306b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u3067\u306f\u9078\u3093\u3060\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306b\u3088\u3063\u3066\u3001<br \/>\n\u5207\u308a\u66ff\u3048\u308b\u30d5\u30a9\u30fc\u30e0\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>funnction.php\u306b\u4ee5\u4e0b\u306e\u8a18\u8ff0\u3092\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\n\/* mw wp form validate *\/\r\nfunction my_validation_rule( $Validation, $data ) {\r\n\r\n  if ( $data['\u6295\u7a3f'] === '\u753b\u50cf' ) {\r\n      $Validation->set_rule( '\u753b\u50cf', 'noEmpty', array(\r\n        'message' => '\u753b\u50cf\u304c\u6dfb\u4ed8\u3055\u308c\u3066\u3044\u307e\u305b\u3093'\r\n      ) );\r\n  }\r\n\tif ( $data['\u6295\u7a3f'] === '\u30c6\u30ad\u30b9\u30c8' ) {\r\n      $Validation->set_rule( '\u30c6\u30ad\u30b9\u30c8', 'noEmpty', array(\r\n        'message' => '\u30c6\u30ad\u30b9\u30c8\u3092\u3054\u8a18\u5165\u4e0b\u3055\u3044\u3002'\r\n      ) );\r\n  }\r\n  return $Validation;\r\n}\r\nadd_filter( 'mwform_validation_mw-wp-form-1582', 'my_validation_rule', 10, 2 );\r\n<\/pre>\n<p>$data[&#8216;\u6295\u7a3f&#8217;] \u306b\u3042\u305f\u308b\u90e8\u5206\u304c\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306ename\u5c5e\u6027\u306b\u3042\u305f\u308b\u90e8\u5206\u3067\u3059\u3002<br \/>\n\u3042\u3068\u306fset_rule\u306b\u30d0\u30ea\u30c7\u30fc\u30c8\u3092\u4ed8\u4e0e\u3057\u305f\u3044\u30d5\u30a9\u30fc\u30e0\u30a8\u30ea\u30a2\u306ename\u5c5e\u6027\u3092\u6307\u5b9a\u3057\u3066\u3042\u3052\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<pre>\r\n\u25a0  \u6295\u7a3f\u3092\u3092\u9078\u629e\r\n[mwform_radio name=\"\u6295\u7a3f\" children=\"\u753b\u50cf,\u30c6\u30ad\u30b9\u30c8]\r\n\r\n\u25a0\u753b\u50cf\u3092\u6dfb\u4ed8\u3057\u3066\u304f\u3060\u3055\u3044\r\n[mwform_file name=\"\u753b\u50cf\"]\r\n\r\n\u25a0\u30c6\u30ad\u30b9\u30c8\u3092\u8a18\u5165\u3057\u3066\u304f\u3060\u3055\u3044\r\n[mwform_text name=\"\u30c6\u30ad\u30b9\u30c8\"]\r\n\r\n\u25a0\u9001\u4fe1\u30dc\u30bf\u30f3\r\n[mwform_submitButton name=\"mwform_submitButton-982\" confirm_value=\"\u78ba\u8a8d\u753b\u9762\u3078\" submit_value=\"\u9001\u4fe1\u3059\u308b\"]\r\n<\/pre>\n<p>\u3042\u3068\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u3067name=&#8221;\u6295\u7a3f&#8221;\u306eval\u306e\u5024\u306b\u3088\u3063\u3066\u8868\u793a\u975e\u8868\u793a\u306e\u6761\u4ef6\u5206\u5c90\u3092\u3057\u3066\u3042\u3052\u308c\u3070\u3001<br \/>\n\u9078\u3093\u3060\u9078\u629e\u80a2\u306b\u3088\u3063\u3066\u8868\u793a\u975e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u30de\u30eb\u30c1\u30d5\u30a9\u30fc\u30e0\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\r\n<script>\r\n$(function() {\r\n $('[name=\"\u6295\u7a3f\"]:radio').change(function() {\r\n  \r\n  if ($(\"input:radio[name='\u6295\u7a3f']:checked\").val() == \"\u753b\u50cf\") {\r\n   $('.kaiga').show();\r\n   $('.haiku').hide();\r\n  } else if($(\"input:radio[name='\u6295\u7a3f']:checked\").val() == \"\u30c6\u30ad\u30b9\u30c8\") {\r\n   $('.haiku').show();\r\n   $('.kaiga').hide();\r\n  }\r\n }).trigger('change'); \r\n});\r\n<\/script>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>mw wpform\u3067\u6761\u4ef6\u5206\u5c90\u30d5\u30a9\u30fc\u30e0\u3067\u3042\u308a\u306a\u304c\u3089\u3001\u305d\u308c\u305e\u308c\u306e\u30d5\u30a9\u30fc\u30e0\u306b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002 \u4ee5\u4e0b\u3067\u306f\u9078\u3093\u3060\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306b\u3088\u3063\u3066\u3001 \u5207\u308a\u66ff\u3048\u308b\u30d5\u30a9\u30fc\u30e0\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002 funnction.php\u306b\u4ee5\u4e0b\u306e\u8a18 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"","_original_post":"","footnotes":""},"categories":[1],"tags":[],"publishpress_future_action":{"enabled":false,"date":"2026-04-11 17:04:57","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category"},"_links":{"self":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1585"}],"collection":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/comments?post=1585"}],"version-history":[{"count":0,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1585\/revisions"}],"wp:attachment":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/media?parent=1585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/categories?post=1585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/tags?post=1585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}