PHP & JavaScript Room :: 設置サンプル

実行結果

Maked Input Plugin | 設置サンプル

日付99/99/9999
電話番号(999) 999-9999
製造番号a*-999-a999
郵便番号999-9999

設置サンプルのソース

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta http-equiv="Content-Language" content="ja" />
      <meta http-equiv="Content-Script-Type" content="text/javascript" />
      <meta http-equiv="Content-Style-Type" content="text/css" />
      <meta http-equiv="imagetoolbar" content="no" />
      <title>Maked Input Plugin | 設置サンプル</title>
      <link rel="stylesheet" href="/content/lib/global.css" type="text/css" />
      <!-- JS -->
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
      <script type="text/javascript" src="/content/lib/jquery/jquery.maskedinput-1.2.1.js"></script>
      <script type="text/javascript">
         jQuery.noConflict();(function($) {
            $(function() {
                 /* 日付 */
               $('#date').mask('99/99/9999');
               /* 電話番号 */
               $('#phone').mask('(999) 999-9999');
               /* 製造番号 */
               $("#product").mask("a*-999-a999",{placeholder:" ",completed:function(){alert("You typed the following: "+this.val());}});
               /* 郵便番号 */
               $("#zipcode").mask("999-9999");
            });
         })(jQuery);
      </script>
      <!-- CSS -->
      <style type="text/css">input { width:15em; }</style>
   <link rel="stylesheet" type="text/css" href="/common/css/example.css"></head>
   <body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP &amp; JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
      <div id="wrap">
         <h1><a href='http://digitalbush.com/projects/masked-input-plugin/'>Maked Input Plugin</a> | 設置サンプル</h1>
<!-- CODE -->
         <table>
            <tr><td>日付</td><td><input id="date" type="text" tabindex="1" /></td><td>99/99/9999</td></tr>
            <tr><td>電話番号</td><td><input id="phone" type="text" tabindex="2" /></td><td>(999) 999-9999</td></tr>
            <tr><td>製造番号</td><td><input id="product" type="text" tabindex="3" /></td><td>a*-999-a999</td></tr>
            <tr><td>郵便番号</td><td><input id="zipcode" type="text" tabindex="4" /></td><td>999-9999</td></tr>
         </table>
<!-- / CODE -->
      </div>
   </body>
</html>