平成30/ 2018-10-23 19:48
JAVASCRIPT/ 郵便番号 住所 入力補助

<script src="http://ajaxzip3.googlecode.com/svn/trunk/ajaxzip3/ajaxzip3.js" charset="UTF-8"></script>

SSLページの場合は以下。
<script src="https://ajaxzip3.googlecode.com/svn/trunk/ajaxzip3/ajaxzip3-https.js" charset="UTF-8"></script>


<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <th>郵便番号</th>
        <td>&#12306;
            <input name="zipcode1" id="zipcode1"  type="text" class="com_wd01" value="<?php
echo h($dt["zipcode1"]); ?>" /> -
            <input name="zipcode2" id="zipcode2" type="text" class="com_wd01" value="<?php
echo h($dt["zipcode2"]); ?>" /> 
            <input name="add_search_btn" type="button" value="住所検索" onclick="javascript:
AjaxZip3.zip2addr('zipcode1', 'zipcode2', 'pref', 'city', 'st_num');" /><span class="ht">(半角数字)例:152-0004</span>
             <div id="zipcode_err"></div>
         </td>
    </tr>
    <tr>
        <th>都道府県<span class="his">※必須</span></th>
        <td><input name="pref" id="pref" type="text" class="com_wd02" value="<?php
echo h($dt["pref"]); ?>" /><span class="ht">例:東京都 </span>
        <div id="pref_err"></div>
        </td>
    </tr>
    <tr>
        <th>市区町村<span class="his">※必須</span></th>
        <td><input name="city" id="city" type="text" class="com_wd02" value="<?php
echo h($dt["city"]); ?>" /><span class="ht">例:目黒区 </span>
        <div id="city_err"></div>
        </td>
    </tr>
    <tr>
        <th>番地<span class="his">※必須</span></th>
        <td><input name="st_num" id="st_num" type="text" class="com_wd03" value="<?php
echo h($dt["st_num"]); ?>" /><span class="ht">例:鷹番3-23-10 </span>
        <div id="st_num_err"></div>
        </td>
    </tr>
    <tr>
        <th>建物名 部屋番号</th>
        <td><input name="apt_hse" type="text" class="com_wd03" value="<?php
echo h($dt["apt_hse"]); ?>" /><span class="ht">例:PARKHABIO 学芸大学104</span></td>
    </tr><tr>
        <th>お名前<span class="his">※必須</span></th>
        <td><input name="name" id="name" type="text" class="com_wd02" value="<?php
echo h($dt["name"]); ?>" /><span class="ht">例:鈴木太郎</span>
        <div id="name_err"></div>
        </td>
    </tr>
</table>


( Thanks. )
http://ninkigumi.com/ajaxzip3/
http://code.google.com/p/ajaxzip3/