A checkbox field (with optional page link) that must be checked for form validation to succeed.
// when building a Form's fields
$fields->push(
TermsAndConditionsCheckboxField::create()
->setTermsPage(SiteTree::get_by_link("terms-and-conditions"));
);
Either set the field's Title, or update lang file:
en:
TermsAndConditionsCheckboxField:
PageLinkContent: "I agree to the <a href=\"{TermsPageLink}\" target=\"new\" title=\"Read the terms and conditions for this site\">{TermsPageTitle}</a>."