An acceptance checkbox is a simple checkbox dedicated to confirming the submitter’s consent for a specific condition. Contact Form 7 provides the
acceptance form-tag type to represent acceptance checkboxes.
To use an acceptance checkbox in your contact form, simply insert an
[acceptance] form-tag into the Form tab panel field like this:
[acceptance your-consent] I consent to the conditions. [/acceptance]
Notice that, unlike other form-tag types, the
[acceptance] tag has a closing tag (
[/acceptance]) at the tail. The part between the opening and closing tags is the content of the form-tag. When you set content to an acceptance checkbox form-tag, it is interpreted as the condition for consent.
If you use Flamingo to store submission data to the database, the information about submitters’ consent will also be stored, and Flamingo allows you to do future reference.
By default, an acceptance checkbox works as a required field, so you can’t submit the form without selecting the checkbox. If you set the
optional option explicitly, the checkbox works as an optional field. If you set the
invert option, it will invert the behavior so, in this case, you can’t submit the form without clearing the checkbox.
id attribute value of the
class attribute value of the
input element. To set two or more classes, you can use multiple
class: option, like
[acceptance accept-this class:y2008 class:m01 class:d01].
|The acceptance checkbox works as an optional field.
|Allow users to submit only if they clear the checkbox.
|The checkbox is selected by default.
Note: This is a demo. This form doesn’t send a mail practically.
View source of the preceding form:
[acceptance accept-this-1] Check here if you accept these terms. [/acceptance]
[acceptance accept-this-2 invert] Uncheck here if you accept these terms. [/acceptance]
3) Selected by default + Inverted
[acceptance accept-this-3 invert default:on] Uncheck here if you accept these terms. [/acceptance]
Acceptance as validation
By default, an acceptance checkbox is a different mechanism than general input validation, and it runs after all validation succeeds. You might want to change this behavior to make it work like other validation because you think it’s less confusing for submitters than the default behavior. In such cases, add this line to the Additional Settings section:
This setting makes all acceptance checkboxes in the form work like validation, and shows the usual validation error message next to the checkbox if the submitter doesn’t check the box.