diff --git a/classes/models/fields/FrmFieldCaptcha.php b/classes/models/fields/FrmFieldCaptcha.php index f0f696553b..2ac8cdb71c 100644 --- a/classes/models/fields/FrmFieldCaptcha.php +++ b/classes/models/fields/FrmFieldCaptcha.php @@ -72,7 +72,11 @@ protected function extra_field_opts() { } /** - * Replace the "for" attribute for captcha field so it matches the response ID. + * Modify the captcha field label so it is not orphaned. + * + * The label is omitted when the label position is set to "none". + * When the label is visible it is rendered as a instead of a \s*~s', '', $html ); + } + + // Convert a CAPTCHA label to a span to prevent an orphaned label issue in WAVE. + return preg_replace( + '~]*?)\s*for="field_\[key\]"([^>]*?)>(.*?)~s', + '$3', + $html + ); } /**