{"id":72,"date":"2021-04-21T04:05:06","date_gmt":"2021-04-20T19:05:06","guid":{"rendered":"https:\/\/tech.for-easy-learning.com\/?p=72"},"modified":"2021-04-29T12:12:56","modified_gmt":"2021-04-29T03:12:56","slug":"form-%e3%81%ae-onsubmit-%e3%81%8c%e3%82%ad%e3%83%a3%e3%83%b3%e3%82%bb%e3%83%ab%e3%81%a7%e3%81%8d%e3%81%aa%e3%81%84%e6%99%82%e3%81%ae%e5%af%be%e5%87%a6%e6%b3%95","status":"publish","type":"post","link":"https:\/\/tech.for-easy-learning.com\/?p=72","title":{"rendered":"\u3010HTML\/JS\u3011Form \u306e onsubmit \u304c\u30ad\u30e3\u30f3\u30bb\u30eb\u3067\u304d\u306a\u3044\u6642\u306e\u5bfe\u51e6\u6cd5"},"content":{"rendered":"\n<p>HTML \u3067 Form \u3092\u4f5c\u3063\u3066\u9001\u4fe1\u524d\u306b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\uff08\u5165\u529b\u5185\u5bb9\u304c\u6b63\u3057\u3044\u304b\u78ba\u8a8d\uff09\u3057\u305f\u3044\u6642\u306a\u3069\u306b onsubmit \u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u307e\u3059\u3088\u306d\u3002<br>\u4eca\u56de\u3001\u30ad\u30e3\u30f3\u30bb\u30eb\u3067\u304d\u306a\u304f\u3066\u8b0e\u306b 1\u6642\u9593\u307b\u3069\u6d88\u8017\u3057\u3066\u6094\u3057\u304b\u3063\u305f\u306e\u3067\u3082\u3046\u8ab0\u3082\u3053\u3093\u306a\u30df\u30b9\u3092\u3057\u306a\u304f\u3066\u3044\u3044\u3088\u3046\u306b\u66f8\u3044\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<h1>\u539f\u56e0: Form \u3058\u3083\u306a\u304f\u3066 &lt;Input type=&#8221;submit&#8221;&gt; \u306b onsubmit \u3092\u66f8\u3044\u3066\u3044\u305f<\/h1>\n\n\n\n<p><br>\u60b2\u3057\u904e\u304e\u307e\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u6b63\u3057\u3044\u306e\u304c\u3053\u3063\u3061\u3002<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"toolbar:1 lang:default mark:1 decode:true \" title=\"\u6b63\u3057\u3044\" >&lt;Form action=\"hoge\" method=\"GET or POST\" onsubmit=\"return validate();\"&gt;\n\u3000&lt;Input type=\"text\" name=\"fuga\"&gt;\n\u3000&lt;Input type=\"submit\" value=\"submit\"&gt;\n&lt;\/Form&gt;<\/pre><\/div>\n\n\n\n<p>\u3053\u3063\u3061\u304c\u9593\u9055\u3044\u3002<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"toolbar:1 lang:default mark:3 decode:true \" title=\"\u9593\u9055\u3044\" >&lt;Form action=\"hoge\" method=\"GET or POST\"&gt;\n\u3000&lt;Input type=\"text\" name=\"fuga\"&gt;\n\u3000&lt;Input type=\"submit\" value=\"submit\" onsubmit=\"return validate();\"&gt;\n&lt;\/Form&gt;<\/pre><\/div>\n\n\n\n<p><code>&lt;input type=\"submit\"><\/code> \u306b\u306f onclick \u306f\u53cd\u5fdc\u3059\u308b\u304b\u3089\u4f59\u8a08\u306b\u30cf\u30de\u3063\u3066\u3057\u307e\u3063\u305f\u3002<\/p>\n\n\n\n<h1>\u305d\u306e\u4ed6\u306e\u539f\u56e0\uff11<\/h1>\n\n\n\n<p><br>\u3042\u308a\u304c\u3061\u306a\u306e\u306f onsubmit \u306e\u66f8\u304d\u65b9\u3002onsubmit \u306f function \u306a\u306e\u3067\u6700\u5f8c\u306b <code>return false<\/code> \u3092\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u3060\u3051\u3069\u3001\u4f8b\u3048\u3070 <code>onsubmit=\"validate();\"<\/code> \u3060\u3068 <code>validate()<\/code> \u3067\u3044\u304f\u3089 <code>return false<\/code> \u3092\u8fd4\u3057\u3066\u3044\u3066\u3082 onsubmit \u306e function \u5185\u3067\u306f\u4f55\u3082\u8fd4\u3063\u3066\u3044\u306a\u3044\u3002<\/p>\n\n\n\n<p><strong>\u6b63\u3057\u304f\u306f onsubmit=&#8221;return validate();&#8221; \u3068\u3059\u308b\u3002<\/strong><br>\u4f55\u304b\u51e6\u7406\u3057\u305f\u4e0a\u3067\u5e38\u306b\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u305f\u3044\u306a\u3089 <code>onsubmit=\"something(); return false;\"<\/code> \u3068\u3059\u308c\u3070\u3044\u3044\u3002\u5e38\u306b\u30ad\u30e3\u30f3\u30bb\u30eb\u3067\u3042\u308a\u304c\u3061\u306a\u5931\u6557\u304c <code>onsubmit=\"false\"<\/code> \u3053\u308c\u3082 <code>onsubmit=\"return false;\"<\/code> \u3068\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<\/p>\n\n\n\n<p>\u3064\u307e\u308a\u3001 <code>onsubmit=\"\"<\/code> \u306f\u3001\u5b9f\u969b\u306b\u306f <code>onsubmit = function (\u5909\u6570) {  }<\/code> \u306a\u306e\u3067<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function (hoge) {\n\u3000validate();\n}<\/code><\/pre>\n\n\n\n<p>\u3067\u306f\u306a\u304f\u3066<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function (hoge) {\n\u3000return validate();\n}<\/code><\/pre>\n\n\n\n<p><br>\u3068\u3057\u306a\u3044\u3068\u4f55\u3082\u5024\u304c\u8fd4\u3089\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u308b\u3002<\/p>\n\n\n\n<h1>\u305d\u306e\u4ed6\u306e\u539f\u56e0\uff12<\/h1>\n\n\n\n<p><br><strong>JavaScript \u5185\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u308b\u3002<\/strong>\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<p><br>Form \u306e\u30c7\u30d0\u30c3\u30b0\u306e\u5384\u4ecb\u306a\u3068\u3053\u308d\u306f<strong>\u9001\u4fe1\u3055\u308c\u3066\u3057\u307e\u3063\u3066 console.log(); \u306e\u7d50\u679c\u304c\u78ba\u8a8d\u3067\u304d\u306a\u3044<\/strong>\u306e\u3067\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u30c7\u30d0\u30c3\u30b0\u753b\u9762\u3067\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u6d3b\u7528\u3059\u308b\u3002\u3082\u3057\u304f\u306f\u7c21\u5358\u306b <code>alert();<\/code> \u3067\u5206\u5c90\u3084\u5909\u6570\u306e\u4e2d\u8eab\u3092\u8868\u793a\u3057\u3066\u307f\u308b\u3068\u304b\u3067\u30c7\u30d0\u30c3\u30b0\u3057\u3066\u307f\u308b\u3068\u826f\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u3061\u3089\u306e\u8a18\u4e8b\u304c\u3068\u3066\u3082\u4e01\u5be7\u3067\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/qiita.com\/nekoneko-wanwan\/items\/02aed17773833c3ad3b2\" data-type=\"URL\" data-id=\"https:\/\/qiita.com\/nekoneko-wanwan\/items\/02aed17773833c3ad3b2\">Qiita &#8211; \u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u4f7f\u3063\u305fJavaScript\u30c7\u30d0\u30c3\u30b0\u3092\u6574\u7406\u3057\u3066\u307f\u305f\u3010\u518d\u5165\u9580\u3011<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTML \u3067 Form \u3092\u4f5c\u3063\u3066\u9001\u4fe1\u524d\u306b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\uff08\u5165\u529b\u5185\u5bb9\u304c\u6b63\u3057\u3044\u304b\u78ba\u8a8d\uff09\u3057\u305f\u3044\u6642\u306a\u3069\u306b onsubmit \u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u307e\u3059\u3088\u306d\u3002\u4eca\u56de\u3001\u30ad\u30e3\u30f3\u30bb\u30eb\u3067\u304d\u306a\u304f\u3066\u8b0e\u306b 1\u6642\u9593\u307b\u3069\u6d88\u8017\u3057\u3066\u6094\u3057\u304b\u3063\u305f\u306e\u3067\u3082\u3046\u8ab0\u3082\u3053\u3093\u306a\u30df\u30b9&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[2],"tags":[4],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":19,"url":"https:\/\/tech.for-easy-learning.com\/?p=19","url_meta":{"origin":72,"position":0},"title":"\u3010WordPress\u3011\u30b5\u30d6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u304a\u3044\u305fWordPress\u3092\u30eb\u30fc\u30c8\u306b\u8a2d\u5b9a\u3059\u308b","date":"2021\u5e744\u670826\u65e5","format":false,"excerpt":"\u30cd\u30c3\u30c8\u306b\u51fa\u56de\u3063\u3066\u3044\u308b WordPress \u306e\u8a2d\u5b9a\u3067\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304d\u305f wordpress \u30d5\u30a9\u30eb\u2026","rel":"","context":"WordPress","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8,"url":"https:\/\/tech.for-easy-learning.com\/?p=8","url_meta":{"origin":72,"position":1},"title":"\u3010WordPress\u3011mac \u306e\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306b WordPress \u3092\u69cb\u7bc9\u3059\u308b","date":"2021\u5e744\u670827\u65e5","format":false,"excerpt":"WordPress \u3067\u30b5\u30a4\u30c8\u69cb\u7bc9\u3092\u9032\u3081\u308b\u5834\u5408\u3001\u30ec\u30f3\u30bf\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u5951\u7d04\u3059\u308b\u3053\u3068\u304b\u3089\u59cb\u3081\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u2026","rel":"","context":"Web\u5168\u822c","img":{"alt_text":"","src":"https:\/\/i1.wp.com\/tech.for-easy-learning.com\/wp-content\/uploads\/2021\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2021-04-27-9.14.10.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":86,"url":"https:\/\/tech.for-easy-learning.com\/?p=86","url_meta":{"origin":72,"position":2},"title":"\u3010PHP\u3011\u30aa\u30ec\u30aa\u30ec backtrace \u30ed\u30b0\u3092\u51fa\u529b\u3057\u3066\u547c\u51fa\u5143\u3092\u8fbf\u308b","date":"2021\u5e744\u670822\u65e5","format":false,"excerpt":"PHP \u3067\u306f debug_print_backtrace() \u3067\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u8868\u793a\u3067\u304d\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u2026","rel":"","context":"PHP","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10,"url":"https:\/\/tech.for-easy-learning.com\/?p=10","url_meta":{"origin":72,"position":3},"title":"\u3010WordPress\u3011\u30c7\u30fc\u30bf\u3092\u79fb\u884c\u3059\u308b","date":"2021\u5e744\u670827\u65e5","format":false,"excerpt":"\u4fd7\u306b\u3044\u3046 WordPress \u306e\u304a\u5f15\u3063\u8d8a\u3057\u3067\u3059\u3002\u30ec\u30f3\u30bf\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u4e57\u308a\u63db\u3048\u305f\u308a\u3001\u524d\u56de\u306e\u8a18\u4e8b\uff08\u3010Wor\u2026","rel":"","context":"WordPress","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6,"url":"https:\/\/tech.for-easy-learning.com\/?p=6","url_meta":{"origin":72,"position":4},"title":"\u3010WordPress\u3011\u6295\u7a3f\u8005\u3084\u30b3\u30e1\u30f3\u30c8\u3092\u975e\u8868\u793a\u306b\u3059\u308b","date":"2021\u5e744\u670827\u65e5","format":false,"excerpt":"WordPress \u306e\u30c6\u30fc\u30de\u306b\u3088\u3063\u3066\u306f\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u975e\u8868\u793a\u3092\u9078\u629e\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u975e\u8868\u793a\u306b\u3067\u304d\u306a\u3044\u30c6\u30fc\u30de\u2026","rel":"","context":"WordPress","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/tech.for-easy-learning.com\/wp-content\/uploads\/2021\/04\/\u00e3\u0082\u00b9\u00e3\u0082\u00af\u00e3\u0083\u00aa\u00e3\u0083\u00bc\u00e3\u0083\u00b3\u00e3\u0082\u00b7\u00e3\u0083\u00a7\u00e3\u0083\u0083\u00e3\u0083\u0088-2021-04-27-23.09.43.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":63,"url":"https:\/\/tech.for-easy-learning.com\/?p=63","url_meta":{"origin":72,"position":5},"title":"\u3010PHP\u3011\u6b63\u898f\u8868\u73fe\u3092\u7528\u3044\u3066\u6587\u5b57\u5217\u3092\u64cd\u4f5c\u3059\u308b","date":"2021\u5e744\u670823\u65e5","format":false,"excerpt":"PHP \u3067\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u5834\u5408\u3001\u4ee5\u4e0b\u306e PCRE\u95a2\u6570 \u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u76ee\u7684\u306b\u5fdc\u3058\u3066\u4f7f\u3044\u5206\u3051\u308b\u3002 \u95a2\u2026","rel":"","context":"PHP","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=\/wp\/v2\/posts\/72"}],"collection":[{"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72"}],"version-history":[{"count":13,"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":213,"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions\/213"}],"wp:attachment":[{"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.for-easy-learning.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}