<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[iDeasilo]]></provider_name><provider_url><![CDATA[https://ideasilo.wordpress.com]]></provider_url><author_name><![CDATA[Takayuki Miyoshi]]></author_name><author_url><![CDATA[https://ideasilo.wordpress.com/author/miyoshita/]]></author_url><title><![CDATA[Contact Form 7 tag&nbsp;syntax]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>This page explains the syntax of <a href="https://ideasilo.wordpress.com/2007/04/30/contact-form-7/">Contact Form 7</a>&#8216;s <strong>tag</strong>. If you are not familiar with basic usage of Contact Form 7, please see <a href="https://ideasilo.wordpress.com/2007/04/30/contact-form-7/">the plugin&#8217;s homepage</a>.</p>
<p>Contact Form 7 uses &#8220;tags&#8221; for two purposes; one is for form content and the other is for mail (<em>to</em>, <em>from</em> and <em>subject</em> fields and <em>message body</em>). Tags for form content has different syntax from ones for mail.</p>
<p>Example of a tag used in form content:<br />
<strong><code>[email* your-email 60/200 "your-email@example.com"]</code></strong></p>
<p>Example of a tag used in mail:<br />
<strong><code>[your-email]</code></strong></p>
<p>As seen in above examples, a tag for form content generally has more complicated syntax and many options. In the rest of this page, I write mainly about the syntax and options of form content tag.<br />
<!--more--></p>
<h4>Contents</h4>
<ol>
<li><a href="#Base_syntax_of_form_content_tag">Base syntax of form content tag</a></li>
<li><a href="#Tags_for_text_field">Tags for text field (<code>text</code>, <code>text*</code>, <code>email</code> and <code>email*</code>)</a></li>
<li><a href="#Tags_for_text_area">Tags for text area (<code>textarea</code> and <code>textarea*</code>)</a></li>
<li><a href="#Tags_for_drop-down_menu">Tags for drop-down menu (<code>select</code>)</a></li>
<li><a href="#Tags_for_checkboxes">Tags for checkboxes (<code>checkbox</code>)</a></li>
<li><a href="#Tags_for_radio_buttons">Tags for radio buttons (<code>radio</code>)</a></li>
<li><a href="#Tags_for_CAPTCHA_image">Tags for CAPTCHA image (<code>captchac</code>)</a></li>
<li><a href="#Tags_for_CAPTCHA_text_field">Tags for CAPTCHA text field (<code>captchar</code>)</a></li>
</ol>
<p><a name="Base_syntax_of_form_content_tag"></a></p>
<h4>Base syntax of form content tag</h4>
<p>A form content tag consists of a <strong>type</strong>, a <strong>name</strong>, <strong>options</strong> (optional) and <strong>values</strong> (optional).</p>
<p>Here is the syntax rule with my bogus BNF.</p>
<blockquote>
<dl>
<dt><code>form content tag =</code></dt>
<dd><code>"[" type name option* value* "]"</code></dd>
<dt><code>type =</code></dt>
<dd><code>"text" | "text*" | "email" | "email*" | "textarea" | "textarea*" | "select" | "checkbox" | "radio" | "captchac" | "captchar"</code></dd>
<dt><code>name =</code></dt>
<dd>(same constraint <a href="http://www.w3.org/TR/html4/interact/forms.html#edef-INPUT">as the <code>name</code> attribute of the <code>input</code> element</a>)</dd>
<dt><code>option =</code></dt>
<dd><code>space [0-9A-Za-z:#_/-]+</code></dd>
<dt><code>value =</code></dt>
<dd><code>space ('"' string '"' | "'" string "'")</code></dd>
</dl>
</blockquote>
<p><code>submit</code> type tag is an exception. It doesn&#8217;t have name.</p>
<p><a name="Tags_for_text_field"></a></p>
<h4>Tags for text field (<code>text</code>, <code>text*</code>, <code>email</code> and <code>email*</code>)</h4>
<dl>
<dt>Description</dt>
<dd>A tag with type of <code>text</code>, <code>text*</code>, <code>email</code> or <code>email*</code> is replaced by a text input field. The difference among the four types is how input text is validated. <code>text*</code> and <code>email*</code> suppose inputs are not blank, so they are used for required fields. <code>email</code> and <code>email*</code> suppose inputs are email address.</dd>
<dt>Example</dt>
<dd><code><strong>[text your-name 40/100 "Your Name"]</strong></code><br />
<code><strong>[email* your-email 40/ class:email akismet:author_email]</strong></code></dd>
<dt>Options</dt>
<dd>
<table border="1" cellpadding="6" rules="all">
<tr>
<td><em>(size)</em><code>/</code><em>(maxlength)</em></td>
<td>Field size and max length. You can omit one of them, like <code>40/</code> or <code>/100</code>.</td>
</tr>
<tr>
<td><code>id:</code><em>(id)</em></td>
<td><code>id</code> attribute value of the <code>input</code> element.</td>
</tr>
<tr>
<td><code>class:</code><em>(class)</em></td>
<td><code>class</code> attribute value of the <code>input</code> element. To set two or more classes, you can use multiple <code>class:</code> option, like <code>[text your-text class:y2008 class:m01 class:d01]</code>.</td>
</tr>
<tr>
<td>
<code>akismet:author</code><br />
<code>akismet:author_url</code><br />
<code>akismet:author_email</code>
</td>
<td>Options for using Akismet (spam filter). See <a href="https://ideasilo.wordpress.com/2007/04/30/contact-form-7/#How_to_use_Akismet_on_Contact_Form_7">here</a>.</td>
</tr>
</table>
</dd>
<dt>Values</dt>
<dd>A tag with this type can accept only one value and the value is used as default input value.</dd>
</dl>
<p><a name="Tags_for_text_area"></a></p>
<h4>Tags for text area (<code>textarea</code> and <code>textarea*</code>)</h4>
<dl>
<dt>Description</dt>
<dd>
A tag with type of <code>textarea</code> or <code>textarea*</code> is replaced by a text area. <code>textarea*</code> supposes input is not blank, so it is used for required fields. While <code>textarea</code> accepts blank input.
</dd>
<dt>Example</dt>
<dd><code><strong>[textarea your-message 40&#120;10]</strong></code></dd>
<dt>Options</dt>
<dd>
<table border="1" cellpadding="6" rules="all">
<tr>
<td><em>(cols)</em><code>x</code><em>(rows)</em></td>
<td>Columns (width) and rows (height) of text area. You can omit one of them, like <code>40x</code> or <code>x10</code></td>
</tr>
<tr>
<td><code>id:</code><em>(id)</em></td>
<td><code>id</code> attribute value of the <code>textarea</code> element.</td>
</tr>
<tr>
<td><code>class:</code><em>(class)</em></td>
<td><code>class</code> attribute value of the <code>textarea</code> element. To set two or more classes, you can use multiple <code>class:</code> option, like <code>[textarea your-text class:y2008 class:m01 class:d01]</code>.</td>
</tr>
</table>
</dd>
<dt>Values</dt>
<dd>A tag with this type can accept only one value and the value is used as default input value.</dd>
</dl>
<p><a name="Tags_for_drop-down_menu"></a></p>
<h4>Tags for drop-down menu (<code>select</code>)</h4>
<dl>
<dt>Description</dt>
<dd>A tag with <code>select</code> type is replaced by a drop-down menu and its options.
</dd>
<dt>Example</dt>
<dd><code><strong>[select your-menu "A" "B" "C"]</strong></code></dd>
<dt>Options</dt>
<dd>
<table border="1" cellpadding="6" rules="all">
<tr>
<td><code>multiple</code></td>
<td>Make drop-down menu multi-selectable.</td>
</tr>
<tr>
<td><code>include_blank</code></td>
<td>Insert a blank item &#8220;&#8212;&#8221; into the top of options of this drop-down menu.</td>
</tr>
<tr>
<td><code>default:<em>(num)</em></code></td>
<td>Pre-selected options. The integer following <code>default:</code> is the position in the order of items. 1 is the first one. If you want to make two or more items selected, joint integers with _(underbar), as <code>default:1_2_3</code>.</td>
</tr>
<tr>
<td><code>id:</code><em>(id)</em></td>
<td><code>id</code> attribute value of the <code>select</code> element.</td>
</tr>
<tr>
<td><code>class:</code><em>(class)</em></td>
<td><code>class</code> attribute value of the <code>select</code> element. To set two or more classes, you can use multiple <code>class:</code> option, like <code>[select your-menu class:y2008 class:m01 class:d01]</code>.</td>
</tr>
</table>
</dd>
<dt>Values</dt>
<dd>A tag with this type can accept multiple values. The values are used as options of the selection.</dd>
</dl>
<p><a name="Tags_for_checkboxes"></a></p>
<h4>Tags for checkboxes (<code>checkbox</code>)</h4>
<dl>
<dt>Description</dt>
<dd>A tag with <code>checkbox</code> type is replaced by a set of checkboxes.
</dd>
<dt>Example</dt>
<dd><code><strong>[checkbox your-checkbox "a" "b" "c"]</strong></code></dd>
<dt>Options</dt>
<dd>
<table border="1" cellpadding="6" rules="all">
<tr>
<td><code>exclusive</code></td>
<td>Make checkboxes exclusive. I mean, when you check a checkbox in the set, others are unchecked, so zero checked or one checked. This is a JavaScript gimmick, so JavaScript on client side is needed.</td>
</tr>
<tr>
<td><code>default:<em>(num)</em></code></td>
<td>Pre-checked options. The integer following <code>default:</code> is the position in the order of items. 1 is the first one. If you want to make two or more items selected, joint integers with _(underbar), as <code>default:1_2_3</code>.</td>
</tr>
<tr>
<td><code>id:</code><em>(id)</em></td>
<td><code>id</code> attribute value of the <code>span</code> element surrounding checkboxes.</td>
</tr>
<tr>
<td><code>class:</code><em>(class)</em></td>
<td><code>class</code> attribute value of the <code>span</code> element surrounding checkboxes. To set two or more classes, you can use multiple <code>class:</code> option, like <code>[checkbox your-checkbox class:y2008 class:m01 class:d01]</code>.</td>
</tr>
</table>
</dd>
<dt>Values</dt>
<dd>A tag with this type can accept multiple values. The values are used as checkbox values.</dd>
</dl>
<p><a name="Tags_for_radio_buttons"></a></p>
<h4>Tags for radio buttons (<code>radio</code>)</h4>
<dl>
<dt>Description</dt>
<dd>A tag with <code>radio</code> type is replaced by a set of radio buttons.
</dd>
<dt>Example</dt>
<dd><code><strong>[radio your-radio "a" "b" "c"]</strong></code></dd>
<dt>Options</dt>
<dd>
<table border="1" cellpadding="6" rules="all">
<tr>
<td><code>default:<em>(num)</em></code></td>
<td>Pre-checked options. The integer following <code>default:</code> is the position in the order of items. 1 is the first one.</td>
</tr>
<tr>
<td><code>id:</code><em>(id)</em></td>
<td><code>id</code> attribute value of the <code>span</code> element surrounding radio buttons.</td>
</tr>
<tr>
<td><code>class:</code><em>(class)</em></td>
<td><code>class</code> attribute value of the <code>span</code> element surrounding radio buttons. To set two or more classes, you can use multiple <code>class:</code> option, like <code>[radio your-radio class:y2008 class:m01 class:d01]</code>.</td>
</tr>
</table>
</dd>
<dt>Values</dt>
<dd>A tag with this type can accept multiple values. The values are used as radio button values.</dd>
</dl>
<p><a name="Tags_for_CAPTCHA_image"></a></p>
<h4>Tags for CAPTCHA image (<code>captchac</code>)</h4>
<dl>
<dt>Description</dt>
<dd>A tag with <code>captchac</code> type is replaced by a <a href="http://en.wikipedia.org/wiki/CAPTCHA">CAPTCHA</a> image. See also <a href="https://ideasilo.wordpress.com/2007/10/07/contact-form-7-15/">how to use CAPTCHA</a>.
</dd>
<dt>Example</dt>
<dd><code><strong>[captchac your-captcha size:s fg:#ffffff bg:#000000]</strong></code></dd>
<dt>Options</dt>
<dd>
<table border="1" cellpadding="6" rules="all">
<tr>
<td><code>size:<em>(sml)</em></code></td>
<td>Image size. Only <code>size:s</code> (60×20), <code>size:m</code> (72×24) and <code>size:l</code> (84×28) are available.</td>
</tr>
<tr>
<td><code>fg:#</code><em>(hex)</em></td>
<td>Foreground color of the CAPTCHA image. Put RGB color code in hex format after <code>fg:#</code> as <code>fg:#ff0000</code></td>
</tr>
<tr>
<td><code>bg:#</code><em>(hex)</em></td>
<td>Background color of the CAPTCHA image. Put RGB color code in hex format after <code>bg:#</code> as <code>bg:#ff0000</code></td>
</tr>
<tr>
<td><code>id:</code><em>(id)</em></td>
<td><code>id</code> attribute value of the <code>img</code> element for the CAPTCHA image.</td>
</tr>
<tr>
<td><code>class:</code><em>(class)</em></td>
<td><code>class</code> attribute value of the <code>img</code> element for the CAPTCHA image. To set two or more classes, you can use multiple <code>class:</code> option, like <code>[captchac your-captcha class:y2008 class:m01 class:d01]</code>.</td>
</tr>
</table>
</dd>
<dt>Values</dt>
<dd>A tag with this type can not accept values.</dd>
</dl>
<p><a name="Tags_for_CAPTCHA_text_field"></a></p>
<h4>Tags for CAPTCHA text field (<code>captchar</code>)</h4>
<dl>
<dt>Description</dt>
<dd>A tag with <code>captchar</code> type is replaced by a <a href="http://en.wikipedia.org/wiki/CAPTCHA">CAPTCHA</a> text input field. See also <a href="https://ideasilo.wordpress.com/2007/10/07/contact-form-7-15/">how to use CAPTCHA</a>.
</dd>
<dt>Example</dt>
<dd><code><strong>[captchar your-captcha 40/100]</strong></code></dd>
<dt>Options</dt>
<dd>
<table border="1" cellpadding="6" rules="all">
<tr>
<td><em>(size)</em><code>/</code><em>(maxlength)</em></td>
<td>Field size and max length. You can omit one of them, like <code>40/</code> or <code>/100</code>.</td>
</tr>
<tr>
<td><code>id:</code><em>(id)</em></td>
<td><code>id</code> attribute value of the <code>input</code> element.</td>
</tr>
<tr>
<td><code>class:</code><em>(class)</em></td>
<td><code>class</code> attribute value of the <code>input</code> element. To set two or more classes, you can use multiple <code>class:</code> option, like <code>[captchar your-captcha class:y2008 class:m01 class:d01]</code>.</td>
</tr>
</table>
</dd>
<dt>Values</dt>
<dd>A tag with this type can accept only one value and the value is used as default input value.</dd>
</dl>
]]></html></oembed>