contact form 7 で住所自動挿入

head内に以下を挿入。

<script src="https://ajaxzip3.github.io/ajaxzip3.js" charset="UTF-8"></script>
<script type="text/javascript">
jQuery(function(){
  jQuery('#zip').keyup(function(event){
    AjaxZip3.zip2addr(this,'','address','address');
  })
})
</script>

フォームの郵便番号と住所のところを以下のように設定。「id:zip」と「id:address」のところ。

  <tr>
    <th scope="row">郵便番号(ハイフン不要)</th>
    <td>[text zip 7/7 id:zip]</td>
  </tr>
  <tr>
    <th scope="row">ご住所</th>
    <td>[text address id:address]</td>
  </tr>

 

ページトップへ移動