<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fluent Form &#8211; オヤマシティ</title>
	<atom:link href="https://www.oyamacity.com/tag/fluent-form/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.oyamacity.com</link>
	<description>栃木県小山市ポータルサイト</description>
	<lastBuildDate>Thu, 17 Aug 2023 14:50:45 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.oyamacity.com/ptl/wp-content/uploads/2021/02/cropped-oyamacity-32x32.png</url>
	<title>Fluent Form &#8211; オヤマシティ</title>
	<link>https://www.oyamacity.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>郵便番号で住所を自動入力</title>
		<link>https://www.oyamacity.com/web/30520/</link>
					<comments>https://www.oyamacity.com/web/30520/#respond</comments>
		
		<dc:creator><![CDATA[サイト管理者]]></dc:creator>
		<pubDate>Tue, 02 Aug 2022 12:07:16 +0000</pubDate>
				<category><![CDATA[Plugin]]></category>
		<category><![CDATA[ホームページ制作]]></category>
		<category><![CDATA[Fluent Form]]></category>
		<guid isPermaLink="false">https://www.oyamacity.com/?p=30520</guid>

					<description><![CDATA[今更ですが、郵便番号を入力することで、住所を自動入力させるアレをFluent Formに実装しましょう。まず最初に、問答無用で、Wordpressの[外観]→[テーマファイルエディター]→childテーマの[functi [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>今更ですが、郵便番号を入力することで、住所を自動入力させるアレをFluent Formに実装しましょう。<br>まず最初に、問答無用で、Wordpressの[外観]→[テーマファイルエディター]→childテーマの[function.php]に以下を書き込みます。<br>（childテーマが分からない場合、「子テーマ」で検索して調べてください）</p>



<p>/****<br>郵便番号呼び出し<br>**/<br>function meta_headcustomtags() {<br>$headcustomtag = &lt;&lt;&lt;EOM</p>



<p>EOM;<br>echo $headcustomtag;<br>}<br>add_action( &#8216;wp_head&#8217;, &#8216;meta_headcustomtags&#8217;, 99);</p>



<p>Fluent Formのフォームパーツには、IDやクラス名など、様々な属性を付与するための入力欄が備わっています。<br>但し少々癖があり、「ff_3_クラス名」の様に頭に勝手にFluentFormの頭文字＋フォームIDが付与されるものもあったりしますので、<br>付与したIDまたはクラスで動かないときは、コードを一度見てください。</p>



<p>さて、この属性の入力欄ですが、これから実装する郵便番号での住所自動登録に必須となる、<br>onkeyup=&#8221;AjaxZip3.zip2addr(this,&#8221;,&#8217;hogehoge&#8217;,&#8217;fugafuga&#8217;);&#8221; を入れる為の入力欄はありません。がしかし、<br>Fluent Formには、CSSとJavascriptを書き込む欄がありますので、自分で振ったIDがあるパーツに対し、以下のJavascriptを書き込みます。</p>



<p>今回は事前に以下のようなIDを振っています。<br>郵便番号：　zipcode<br>都道府県：　prefecture<br>郡・市区町村：　city</p>



<p>[JavaScript]<br>var sample = document.getElementById(&#8216;ff_3_zipcode&#8217;);<br>sample.setAttribute(&#8216;onKeyUp&#8217;, &#8220;AjaxZip3.zip2addr(this,&#8221;,&#8217;prefecture&#8217;,&#8217;city&#8217;);&#8221;);</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.oyamacity.com/web/30520/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
