{"id":20,"date":"2017-04-16T14:07:38","date_gmt":"2017-04-16T05:07:38","guid":{"rendered":"http:\/\/syrup-factory.com\/memo\/?p=20"},"modified":"2017-04-17T07:09:36","modified_gmt":"2017-04-16T22:09:36","slug":"input-typetel-email-%e3%82%92%e7%94%9f%e6%88%90%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/syrup-factory.com\/memo\/archives\/20","title":{"rendered":"input type=&#8221;tel&#8221;, &#8220;email&#8221; \u3092\u751f\u6210\u3059\u308b"},"content":{"rendered":"<p>QuickForm2\/Element\/InputTel.php \u3068\u3057\u3066\u4fdd\u5b58\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/**\r\n * Base class for &lt;input&gt; elements\r\n *\/\r\nrequire_once 'HTML\/QuickForm2\/Element\/Input.php';\r\n\r\n\/**\r\n * Class for &lt;input type=&quot;tel&quot; \/&gt; elements\r\n *\r\n * @category HTML\r\n * @package  HTML_QuickForm2\r\n * @author   ushi \r\n * @license  http:\/\/opensource.org\/licenses\/bsd-license.php New BSD License\r\n * @version  Release: 1.0.0\r\n * @link     http:\/\/pear.php.net\/package\/HTML_QuickForm2\r\n *\/\r\nclass HTML_QuickForm2_Element_InputTel extends HTML_QuickForm2_Element_Input\r\n{\r\n    protected $persistent = true;\r\n\r\n    protected $attributes = array('type' =&gt; 'tel');\r\n}\r\n?&gt;\r\n<\/pre>\n<p>QuickForm2\/Element\/InputEmail.php \u3068\u3057\u3066\u4fdd\u5b58\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/**\r\n * Base class for &lt;input&gt; elements\r\n *\/\r\nrequire_once 'HTML\/QuickForm2\/Element\/Input.php';\r\n\r\n\/**\r\n * Class for &lt;input type=&quot;tel&quot; \/&gt; elements\r\n *\r\n * @category HTML\r\n * @package  HTML_QuickForm2\r\n * @author   ushi \r\n * @license  http:\/\/opensource.org\/licenses\/bsd-license.php New BSD License\r\n * @version  Release: 1.0.0\r\n * @link     http:\/\/pear.php.net\/package\/HTML_QuickForm2\r\n *\/\r\nclass HTML_QuickForm2_Element_InputEmail extends HTML_QuickForm2_Element_Input\r\n{\r\n    protected $persistent = true;\r\n\r\n    protected $attributes = array('type' =&gt; 'email');\r\n}\r\n?&gt;\r\n<\/pre>\n<p>QuickForm2\/Factory.php \u306b\u8ffd\u8a18\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n   protected static $elementTypes = array(\r\n        'button'        =&gt; array('HTML_QuickForm2_Element_Button', null),\r\n        'checkbox'      =&gt; array('HTML_QuickForm2_Element_InputCheckbox', null),\r\n\/\/\u4e2d\u7565\r\n        'tel'          =&gt; array('HTML_QuickForm2_Element_InputTel', null),\r\n        'email'          =&gt; array('HTML_QuickForm2_Element_InputEmail', null)\r\n    );\r\n<\/pre>\n<p>PG\u3067\u306e\u4f7f\u3044\u65b9<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n    \/\/\u96fb\u8a71\u756a\u53f7\uff08\u30aa\u30ea\u30b8\u30ca\u30ebtype\uff09\r\n    $in_o_tel = $form-&gt;addElement('tel', 'o_tel',  array('id' =&gt; 'tel', 'autocomplete'=&gt;&quot;tel&quot;, 'placeholder'=&gt;&quot;000-0000-0000&quot;));\r\n\r\n    \/\/email\uff08\u30aa\u30ea\u30b8\u30ca\u30ebtype\uff09\r\n    $in_o_email = $form-&gt;addElement('email', 'o_email',  array('id' =&gt; 'email', 'autocomplete'=&gt;&quot;email&quot;, 'placeholder'=&gt;&quot;hoge@hoge.com&quot;, 'maxlength'=&gt;&quot;100&quot;));\r\n<\/pre>\n<p>Smarty template<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;p&gt;&lt;label for=&quot;tel&quot;&gt; \u96fb\u8a71\u756a\u53f7&lt;\/label&gt;\r\n{$form.o_tel.html}&lt;\/p&gt;\r\n{if isset($errors['o_tel'])}&lt;p class=&quot;error&quot;&gt;{$errors['o_tel']}&lt;\/p&gt;{\/if}\r\n        \r\n&lt;p&gt;&lt;label for=&quot;email&quot;&gt; \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9&lt;\/label&gt;\r\n{$form.o_email.html}&lt;\/p&gt;\r\n{if isset($errors['o_email'])}&lt;p class=&quot;error&quot;&gt;{$errors['o_email']}&lt;\/p&gt;{\/if}\r\n<\/pre>\n<p>\u751f\u6210html\u30bd\u30fc\u30b9<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;p&gt;&lt;label for=&quot;tel&quot;&gt; \u96fb\u8a71\u756a\u53f7&lt;\/label&gt;\r\n  &lt;input type=&quot;tel&quot; id=&quot;tel&quot; autocomplete=&quot;tel&quot; placeholder=&quot;000-0000-0000&quot; name=&quot;o_tel&quot; \/&gt;&lt;\/p&gt;\r\n        \r\n&lt;p&gt;&lt;label for=&quot;email&quot;&gt; \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9&lt;\/label&gt;\r\n  &lt;input type=&quot;email&quot; id=&quot;email&quot; autocomplete=&quot;email&quot; placeholder=&quot;hoge@hoge.com&quot; maxlength=&quot;100&quot; name=&quot;o_email&quot; \/&gt;&lt;\/p&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>QuickForm2\/Element\/InputTel.php \u3068\u3057\u3066\u4fdd\u5b58\u3002 QuickForm2\/ &#8230;<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/syrup-factory.com\/memo\/archives\/20\"><span>Continue reading<\/span><i class=\"crycon-right-dir\"><\/i><\/a> <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3],"tags":[],"_links":{"self":[{"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/posts\/20"}],"collection":[{"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":3,"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":151,"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/posts\/20\/revisions\/151"}],"wp:attachment":[{"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/syrup-factory.com\/memo\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}