Closed pculka closed 6 years ago
You need to add some validation constraint directly to the unmapped field. Like this (untested):
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue as RecaptchaTrue;
$builder->add('recaptcha', EWZRecaptchaType::class, [
'mapped' => false,
'constraints' => [
new RecaptchaTrue([
'validation_groups' => ['manual', 'anonymous'],
])
],
'attr' => [
'options' => [
'theme' => 'light',
'type' => 'image',
'size' => 'normal',
'defer' => true,
'async' => true,
],
],
]);
nopes, it simply does not trigger
When I added a recaptcha field to the Entity, it started validating, but it always triggered an error. Dis weird :/
oh darn! It worked, the private key was wrong :/
Hi, I've created a simple 2-step form using two form types. The form type has included:
But the validation never triggers, even though it's in the flow definition of steps:
I don't get it why it doesn't trigger? When I add the field to the mapped entity, it just works but that's wrong.