承諾確認チェックボックス

特定の条項を承諾したユーザーにだけコンタクトフォームの送信を許可したい場合もあるでしょう。そういう時には acceptance フォームタグが便利です。

使い方は簡単です。次のようにフォーム内に acceptance のタグを挿入してください:

[acceptance accept-this] Check here if you accept these terms.

JavaScript の仕掛けにより、ユーザーは条項を承諾するチェックボックスにチェックを入れるまでは送信ボタンを押すことさえできません。加えて、invert オプションを指定して、この機能を反転させることも可能です。つまり、チェックボックスのチェックを外さないと送信できないようにします。

acceptance で利用可能なオプション
オプション 使用例 説明
id:(id) id:foo input 要素の id 属性値。
class:(class) class:bar input 要素の class 属性値。2個以上のクラスを設定する場合は複数の class: オプションを [acceptance accept-this class:y2008 class:m01 class:d01] のようにして並べる。
tabindex:(num) tabindex:10 input 要素の tabindex 属性値。
invert チェックボックスのチェックを外さないと送信できないようにする。
default:on デフォルトでチェックボックスがチェックされた状態にする。

デモ

注意: これはデモです。このフォームが実際にメールを送信することはありません。

1) Default
Check here if you accept these terms.

2) Inverted
Uncheck here if you accept these terms.

3) Checked by default + Inverted
Uncheck here if you accept these terms.

上のフォームのソース:

1) Default
[acceptance accept-this-1] Check here if you accept these terms.

2) Inverted
[acceptance accept-this-2 invert] Uncheck here if you accept these terms.

3) Checked by default + Inverted
[acceptance accept-this-3 invert default:on] Uncheck here if you accept these terms.

[submit "Send"]

Comments are closed.