{"id":1003,"date":"2010-04-03T21:21:00","date_gmt":"2010-04-03T01:21:00","guid":{"rendered":""},"modified":"2013-11-17T16:46:59","modified_gmt":"2013-11-17T08:46:59","slug":"maskedit%e4%b8%ad%e6%8e%a9%e7%a0%81%e7%9a%84%e5%90%ab%e4%b9%89%e5%8f%8a%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/1003.html","title":{"rendered":"MaskEdit\u4e2d\u63a9\u7801\u7684\u542b\u4e49\u53ca\u4f7f\u7528"},"content":{"rendered":"<p>MaskEdit\u662f\u7528\u6765\u5efa\u7acb\u7f16\u8f91\u6846\u7684\uff0c\u4f46\u5b83\u4e0eEdit\u7f16\u8f91\u6846\u53ef\u4ee5\u8f93\u5165\u4efb\u610f\u5b57\u7b26\u4e0d\u540c\uff0cMaskEdit\u53ef\u4ee5\u9650\u5236\u7528\u6237\u53ea\u80fd\u6309\u7167\u65e2\u5b9a\u7684\u8f93\u5165\u683c\u5f0f\u8f93\u5165\u3002\u8fd9\u5bf9\u8f93\u5165\u4e00\u4e9b\u6807\u51c6\u683c\u5f0f\u7684\u6570\u636e\u63d0\u4f9b\u4e86\u5f88\u591a\u65b9\u4fbf\u3002\u4e0b\u9762\u6211\u4eec\u6765\u770b\u770b\u5b83\u4e0eEdit\u7684\u4e0d\u540c\u4e4b\u5904J<\/p>\n<div>\n<p>\u3010EditMask\u3011\u5c5e\u6027\uff0c\u8fd9\u4e2a\u5c5e\u6027\u7528\u6765\u8bbe\u7f6e\u7528\u6237\u8f93\u5165\u7684\u683c\u5f0f\uff0c\u82e5\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e0d\u7b26\u5408\u683c\u5f0f\u8981\u6c42\uff0c\u8fd9\u4e2a\u5b57\u7b26\u5c06\u88ab\u62d2\u7edd\u63a5\u53d7\u3002<\/p>\n<p>\u5982\u4f55\u8bbe\u7f6e\u683c\u5f0f\u5462\uff1f\u70b9\u4e00\u4e0b\u5c5e\u6027\u680f\u7684EditMask\u53f3\u8fb9\u7684\u201d\u2026\u201d\uff0c\u5c31\u4f1a\u5f39\u51fa\u4e00\u4e2a\u8bbe\u7f6e\u597d\u683c\u5f0f\u7684\u5bf9\u8bdd\u6846\uff0c\u5728\u90a3\u91cc\u9009\u62e9\u4f60\u9700\u8981\u7684\u683c\u5f0f\u5c31\u53ef\u4ee5\u4e86\u3002\u53ef\u662f\u6709\u65f6\u6211\u4eec\u60f3\u5728\u7a0b\u5e8f\u4e2d\u8bbe\u7f6e\uff0c\u6216\u8005\u73b0\u6709\u7684\u683c\u5f0f\u6839\u672c\u5c31\u6ca1\u6709\u6211\u4eec\u60f3\u8981\u7684\u683c\u5f0f\uff0c\u90a3\u600e\u4e48\u529e\u5462\uff1f<\/p>\n<p>\u597d\u50cf\u5728dbase\u4e2d\u63d0\u8fc7\u6709\u4ec0\u4e48\u63a9\u7801\u7684\uff0c\u4e0d\u6e05\u695a\u5979\u6709\u6ca1\u6709\uff1f\u7b54\u6848\u662f\u4e00\u5b9a\uff0c\u5979\u4e5f\u6709\u4e00\u4e2a\u548cdbase\u5dee\u4e0d\u591a\u7684\u63a9\u7801\u5b57\u7b26\u8868\uff0c\u4e0b\u9762\u6211\u4eec\u6765\u770b\u770b\u8fd9\u4e2a\u8868\uff1a<\/p>\n<p>\u63a9\u7801\u5b57\u7b26\u8868<\/p>\n<p>\u63a9\u7801\u5b57\u7b26<br \/>\n\u610f\u00a0\u00a0\u00a0\u00a0 \u4e49<\/p>\n<p>\uff01<br \/>\n\u53bb\u6389\u8f93\u5165\u6570\u636e\u5f00\u5934\u7684\u7a7a\u683c\u7b26<\/p>\n<p>&gt;<br \/>\n\u8ba9\u8f93\u5165\u6570\u636e\u7684\u5b57\u6bcd\u90fd\u53d8\u6210\u5927\u5199\uff0c\u76f4\u5230\u9047\u4e0a\u63a9\u7801\u5b57\u7b26&lt;<\/p>\n<p>&lt;<br \/>\n\u8ba9\u8f93\u5165\u6570\u636e\u7684\u5b57\u6bcd\u90fd\u53d8\u6210\u5c0f\u5199\uff0c\u76f4\u5230\u9047\u4e0a\u63a9\u7801\u5b57\u7b26&gt;<\/p>\n<p>&lt;&gt;<br \/>\n\u4e0d\u9650\u5236\u8f93\u5165\u6570\u636e\u5b57\u6bcd\u662f\u5927\u5199\u6216\u5c0f\u5199<\/p>\n<p>\\<br \/>\n\u82e5\u5728\u8f93\u5165\u683c\u5f0f\u5185\u52a0\u5165\u67d0\u4e2a\u7279\u6b8a\u5b57\u7b26\uff0c\u53ea\u8981\u5728\u7279\u6b8a\u5b57\u7b26<\/p>\n<p>\u7684\u524d\u9762\u52a0\u4e0a\u6b64\u63a9\u7801\u5c31\u53ef\u4ee5\u4e86\u3002\u8bf4\u660e\u4e86\u5c31\u548cC\u8bed\u8a00\u4e2d\u7684\u7528\u5728printf\u4e2d\u7684\u90a3\u4e2a\u8f6c\u610f\u5b57\u7b26\u4e00\u6837\uff0c\u54c8\u54c8\u5979\u4eec\u7684\u6a21\u6837\u539f\u6765\u4e5f\u4e00\u6837<\/p>\n<p>L<br \/>\n\u5141\u8bb8\u8f93\u5165\u82f1\u6587\u5b57\u6bcd\uff0c\u800c\u4e14\u4e00\u5b9a\u8981\u8f93\u5165<\/p>\n<p>l<br \/>\n\u5141\u8bb8\u8f93\u5165\u82f1\u6587\u5b57\u6bcd\uff0c\u4e0d\u4e00\u5b9a\u8981\u8f93\u5165<\/p>\n<p>A<br \/>\n\u5141\u8bb8\u8f93\u5165\u82f1\u6587\u5b57\u6bcd\u548c\u963f\u62c9\u4f2f\u6570\u5b57\uff0c\u4e00\u5b9a\u8981\u8f93\u5165<\/p>\n<p>a<br \/>\n\u5141\u8bb8\u8f93\u5165\u82f1\u6587\u5b57\u6bcd\u548c\u963f\u62c9\u4f2f\u6570\u5b57\uff0c\u4e0d\u4e00\u5b9a\u8981\u8f93\u5165<\/p>\n<p>C<br \/>\n\u5141\u8bb8\u8f93\u5165\u4efb\u4f55\u5b57\u7b26\uff0c\u4e00\u5b9a\u8981\u8f93\u5165<\/p>\n<p>c<br \/>\n\u5141\u8bb8\u8f93\u5165\u4efb\u4f55\u5b57\u7b26\uff0c\u4e0d\u4e00\u5b9a\u8981\u8f93\u5165<\/p>\n<p>0<br \/>\n\u5141\u8bb8\u8f93\u5165\u963f\u62c9\u4f2f\u6570\u5b57\uff0c\u4e00\u5b9a\u8981\u8f93\u5165<\/p>\n<p>9<br \/>\n\u5141\u8bb8\u8f93\u5165\u963f\u62c9\u4f2f\u6570\u5b57\uff0c\u4e0d\u4e00\u5b9a\u8981\u8f93\u5165<\/p>\n<p>#<br \/>\n\u5141\u8bb8\u8f93\u5165\u963f\u62c9\u4f2f\u6570\u5b57\u6216\u6b63\u3001\u8d1f\u53f7\u5b57\u7b26<\/p>\n<p>:<br \/>\n\u7528\u6765\u5206\u9694\u65f6\u95f4\u6570\u636e\u4e2d\u7684\u65f6\u3001\u5206\u3001\u79d2<\/p>\n<p>\/<br \/>\n\u7528\u6765\u5206\u9694\u65e5\u671f\u6570\u636e\u4e2d\u7684\u5e74\u3001\u6708\u3001\u65e5<\/p>\n<p>;<br \/>\n\u7528\u6765\u5206\u9694\u63a9\u7801\u5b57\u6bb5<br \/>\n_<br \/>\n\u4ee3\u8868\u7a7a\u683c\u7b26\uff0c\u8fd0\u884c\u65f6\u663e\u793a\u4e0b\u5212\u7ebf\u5b57\u7b26<\/p>\n<p>\u4f8b\uff1a\u7535\u8bdd\u53f7\u7801\u2192!\\(9999\\)999999999;l;_<br \/>\n\u65e5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u671f\u2192!0000\/99\/99;l;_ &lt;\uff0d &#8220;_&#8221;\u662f\u663e\u793a\u65f6\u7a7a\u4f4d\u7684\u8868\u793a\u53ef\u7528\u5176\u4ed6\u5b57\u7b26\u66ff\u4ee3\u3002<br \/>\n^\u662f\u8868\u793a\u662f\u5426\u5728text\u603b\u4fdd\u7559\u5206\u9694\u7b26<\/p>\n<p>\u3010Text\u3011\u3001\u3010EditText\u3011\u8fd9\u4e00\u5bf9\u96be\u5144\u96be\u5f1f\u603b\u88ab\u4eba\u5f04\u9519\uff0c\u56e0\u4e3a\u5979\u4eec\u5b9e\u5728\u592a\u8c61\u4e86\uff0c\u4f46\u5979\u4eec\u8fd8\u662f\u6709\u4e00\u70b9\u4e0d\u4e00\u6837\u7684\uff0c\u5982\u679c\u4f60\u8981\u8fd4\u56de\u5e26\u683c\u5f0f\u7684\u6587\u672c\uff0c\u90a3\u53ea\u80fd\u7528EditText\uff0c\u8981\u662f\u68c0\u67e5\u8fd9\u4e2a\u6587\u672c\u662f\u5426\u4e3a\u7a7a\u90a3\u5c31\u8981\u7528TextJ<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u91cd\u8981\u7684\u65b9\u6cd5\u4f60\u4e0d\u8981\u5fd8\u8bb0\u4e86\uff0c\u90a3\u5c31\u662fValidateEdit()\u3002\u5979\u662f\u505a\u4ec0\u4e48\u7684\u5462\uff1f\u68c0\u67e5\u4f60\u8f93\u5165\u7684\u6587\u672c\u5185\u5bb9\u662f\u5426\u7b26\u5408MaskEdit\u7684\u683c\u5f0f\u8981\u6c42\uff0c\u8981\u662f\u4e0d\u7b26\u5408\uff0c\u6ca1\u529e\u6cd5\uff0c\u8fd4\u56de\u91cd\u65b0\u8f93\u5165\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>MaskEdit\u662f\u7528\u6765\u5efa\u7acb\u7f16\u8f91\u6846\u7684\uff0c\u4f46\u5b83\u4e0eEdit\u7f16\u8f91\u6846\u53ef\u4ee5\u8f93\u5165\u4efb\u610f\u5b57\u7b26\u4e0d\u540c\uff0cMaskEdit\u53ef\u4ee5\u9650\u5236\u7528\u6237\u53ea\u80fd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1003","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/1003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=1003"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/1003\/revisions"}],"predecessor-version":[{"id":4702,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/1003\/revisions\/4702"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=1003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=1003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=1003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}