{"id":169573,"date":"2020-01-21T09:19:52","date_gmt":"2020-01-21T01:19:52","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=169573"},"modified":"2020-01-13T13:19:18","modified_gmt":"2020-01-13T05:19:18","slug":"html-forms-and","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/html-forms-and.html","title":{"rendered":"HTML\u4e4b \u8868\u5355\u4e0e\u8f93\u5165"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nHTML \u8868\u5355\u7528\u4e8e\u6536\u96c6\u4e0d\u540c\u7c7b\u578b\u7684\u7528\u6237\u8f93\u5165\u3002\u8868\u5355\u662f\u4e00\u4e2a\u5305\u542b\u8868\u5355\u5143\u7d20\u7684\u533a\u57df\u3002\u8868\u5355\u5143\u7d20\u662f\u5141\u8bb8\u7528\u6237\u5728\u8868\u5355\u4e2d\u8f93\u5165\u5185\u5bb9,\u6bd4\u5982\uff1a\u6587\u672c\u57df(textarea)\u3001\u4e0b\u62c9\u5217\u8868\u3001\u5355\u9009\u6846(radio-buttons)\u3001\u590d\u9009\u6846(checkboxes)\u7b49\u7b49\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

HTML \u8868\u5355<\/strong><\/div>\n

\u8868\u5355\u662f\u4e00\u4e2a\u5305\u542b\u8868\u5355\u5143\u7d20\u7684\u533a\u57df\u3002<\/p>\n

\u8868\u5355\u5143\u7d20\u662f\u5141\u8bb8\u7528\u6237\u5728\u8868\u5355\u4e2d\u8f93\u5165\u5185\u5bb9,\u6bd4\u5982\uff1a\u6587\u672c\u57df(textarea)\u3001\u4e0b\u62c9\u5217\u8868\u3001\u5355\u9009\u6846(radio-buttons)\u3001\u590d\u9009\u6846(checkboxes)\u7b49\u7b49\u3002
\n\u8868\u5355\u4f7f\u7528\u8868\u5355\u6807\u7b7e<form>\u6765\u8bbe\u7f6e:<\/p>\n

<form>
.
\r\ninput \u5143\u7d20<\/i>
.
\r\n<\/form>
<\/pre>\n
HTML \u8868\u5355 - \u8f93\u5165\u5143\u7d20<\/strong><\/div>\n

\u591a\u6570\u60c5\u51b5\u4e0b\u88ab\u7528\u5230\u7684\u8868\u5355\u6807\u7b7e\u662f\u8f93\u5165\u6807\u7b7e\uff08<input>\uff09\u3002<\/p>\n

\u8f93\u5165\u7c7b\u578b\u662f\u7531\u7c7b\u578b\u5c5e\u6027\uff08type\uff09\u5b9a\u4e49\u7684\u3002\u5927\u591a\u6570\u7ecf\u5e38\u88ab\u7528\u5230\u7684\u8f93\u5165\u7c7b\u578b\u5982\u4e0b\uff1a<\/p>\n

\u6587\u672c\u57df\uff08Text Fields\uff09<\/strong><\/span><\/div>\n

\u6587\u672c\u57df\u901a\u8fc7<input type=\"text\">\u6807\u7b7e\u6765\u8bbe\u5b9a\uff0c\u5f53\u7528\u6237\u8981\u5728\u8868\u5355\u4e2d\u952e\u5165\u5b57\u6bcd\u3001\u6570\u5b57\u7b49\u5185\u5bb9\u65f6\uff0c\u5c31\u4f1a\u7528\u5230\u6587\u672c\u57df\u3002<\/p>\n

<form>
\r\nFirst name:\r\n<input type=\"text\" name=\"firstname\"><br>
\r\nLast name:\r\n<input type=\"text\" name=\"lastname\">
\r\n<\/form><\/pre>\n

\u6d4f\u89c8\u5668\u663e\u793a\u5982\u4e0b\uff1a<\/p>\n

\nFirst name:
\nLast name:
\n<\/form>\n

\u6ce8\u610f<\/strong>:\u8868\u5355\u672c\u8eab\u5e76\u4e0d\u53ef\u89c1\u3002\u540c\u65f6\uff0c\u5728\u5927\u591a\u6570\u6d4f\u89c8\u5668\u4e2d\uff0c\u6587\u672c\u57df\u7684\u9ed8\u8ba4\u5bbd\u5ea6\u662f 20 \u4e2a\u5b57\u7b26\u3002<\/p>\n

\u5bc6\u7801\u5b57\u6bb5<\/strong><\/span><\/div>\n

\u5bc6\u7801\u5b57\u6bb5\u901a\u8fc7\u6807\u7b7e<input type=\"password\"> \u6765\u5b9a\u4e49:<\/p>\n

<form>
\r\nPassword:\r\n<input type=\"password\" name=\"pwd\">
\r\n<\/form><\/pre>\n

\u6d4f\u89c8\u5668\u663e\u793a\u6548\u679c\u5982\u4e0b:<\/p>\n\nPassword:
\n<\/form>\n

\u5355\u9009\u6309\u94ae\uff08Radio Buttons\uff09<\/strong><\/span><\/div>\n

<input type=\"radio\" >\u6807\u7b7e\u5b9a\u4e49\u4e86\u8868\u5355\u5355\u9009\u6846\u9009\u9879<\/p>\n

<form>
\r\n<input type=\"radio\" name=\"sex\" value=\"male\">Male<br>
\r\n<input type=\"radio\" name=\"sex\" value=\"female\">Female
\r\n<\/form><\/pre>\n

\u6d4f\u89c8\u5668\u663e\u793a\u6548\u679c\u5982\u4e0b:<\/p>\n\nMale
\nFemale
\n<\/form>\n

\u590d\u9009\u6846\uff08Checkboxes\uff09<\/strong><\/span><\/div>\n

<input type=\"checkbox\">\u5b9a\u4e49\u4e86\u590d\u9009\u6846. \u7528\u6237\u9700\u8981\u4ece\u82e5\u5e72\u7ed9\u5b9a\u7684\u9009\u62e9\u4e2d\u9009\u53d6\u4e00\u4e2a\u6216\u82e5\u5e72\u9009\u9879\u3002<\/p>\n

<form>
\r\n<input type=\"checkbox\" name=\"vehicle\" value=\"Bike\">I have a bike<br>
\r\n<input type=\"checkbox\" name=\"vehicle\" value=\"Car\">I have a car
\r\n<\/form><\/pre>\n

\u6d4f\u89c8\u5668\u663e\u793a\u6548\u679c\u5982\u4e0b:<\/p>\n\nI have a bike
\nI have a car
\n<\/form>\n

\u63d0\u4ea4\u6309\u94ae(Submit Button)<\/strong><\/span><\/div>\n

<input type=\"submit\">\u5b9a\u4e49\u4e86\u63d0\u4ea4\u6309\u94ae.<\/p>\n

\u5f53\u7528\u6237\u5355\u51fb\u786e\u8ba4\u6309\u94ae\u65f6\uff0c\u8868\u5355\u7684\u5185\u5bb9\u4f1a\u88ab\u4f20\u9001\u5230\u53e6\u4e00\u4e2a\u6587\u4ef6\u3002\u8868\u5355\u7684\u52a8\u4f5c\u5c5e\u6027\u5b9a\u4e49\u4e86\u76ee\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u3002\u7531\u52a8\u4f5c\u5c5e\u6027\u5b9a\u4e49\u7684\u8fd9\u4e2a\u6587\u4ef6\u901a\u5e38\u4f1a\u5bf9\u63a5\u6536\u5230\u7684\u8f93\u5165\u6570\u636e\u8fdb\u884c\u76f8\u5173\u7684\u5904\u7406:<\/p>\n

<form name=\"input\" action=\"html_form_action.php\" method=\"get\">
\r\nUsername:\r\n<input type=\"text\" name=\"user\">
\r\n<input type=\"submit\" value=\"Submit\">
\r\n<\/form><\/pre>\n

\u6d4f\u89c8\u5668\u663e\u793a\u6548\u679c\u5982\u4e0b:<\/p>\n\nUsername:
\n<\/form>\n

\u5047\u5982\u60a8\u5728\u4e0a\u9762\u7684\u6587\u672c\u6846\u5185\u952e\u5165\u51e0\u4e2a\u5b57\u6bcd\uff0c\u7136\u540e\u70b9\u51fb\u786e\u8ba4\u6309\u94ae\uff0c\u90a3\u4e48\u8f93\u5165\u6570\u636e\u4f1a\u4f20\u9001\u5230 \"html_form_action.php\" \u7684\u9875\u9762\u3002\u8be5\u9875\u9762\u5c06\u663e\u793a\u51fa\u8f93\u5165\u7684\u7ed3\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8868\u5355\u662f\u4e00\u4e2a\u5305\u542b\u8868\u5355\u5143\u7d20\u7684\u533a\u57df\u3002 \u8868\u5355\u5143\u7d20\u662f\u5141\u8bb8\u7528\u6237\u5728\u8868\u5355\u4e2d\u8f93\u5165\u5185\u5bb9,\u6bd4\u5982\uff1a\u6587\u672c\u57df(textarea)\u3001\u4e0b\u62c9\u5217\u8868 […]<\/p>\n","protected":false},"author":321,"featured_media":169575,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-169573","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/169573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/321"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=169573"}],"version-history":[{"count":9,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/169573\/revisions"}],"predecessor-version":[{"id":169584,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/169573\/revisions\/169584"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/169575"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=169573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=169573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=169573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}