Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing setRequired(TRUE | FALSE) on field 'recaptcha' in form 'xxxForm' #9

Closed
sallyx opened this issue Apr 4, 2017 · 4 comments
Closed

Comments

@sallyx
Copy link

sallyx commented Apr 4, 2017

$form->addRecaptcha() shows reCaptcha, but not validate it.
$form->addRecaptcha()->setMessage('Are you bot?'); triggers warning "Missing setRequired(TRUE | FALSE) on field 'recaptcha' in form 'xxxForm'"
$form->addRecaptcha()->setRequired(FALSE)->setMessage('Are you bot?'); doesnt validate.
$form->addRecaptcha()->setRequired(TRUE)->setMessage('Are you bot?'); doesnt show 'Are you bot?' but 'This field is required' if form is submited without checking reCaptcha.

@f3l1x
Copy link
Member

f3l1x commented Apr 4, 2017

Thank you for bug report.

What do you suggest?

@f3l1x
Copy link
Member

f3l1x commented Apr 4, 2017

What version of nette do you use?

@sallyx
Copy link
Author

sallyx commented Apr 5, 2017

Nette 2.4

@f3l1x
Copy link
Member

f3l1x commented Apr 5, 2017

Could you try change this rule?

https://github.com/minetro/reCAPTCHA/blob/master/src/Forms/ReCaptchaField.php#L48

Maybe try combination with setOmitted().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants