Open lestercomia opened 7 years ago
What version of SilverStripe are you using? If you are using SilverStripe 4 make sure you are using the latest from master or 2.0.0-alpha2. If you are using SilverStripe 3 make sure you are using 1.0.0 or the latest from 1.0.x.
Also is the error message simply blank? It's also possible if bootstrap is intercepting the submission process for the form you may need to trigger the recaptcha api manually.
Also note the validation error message will only show after submission to the server as validation is done server side. It will not show up prior to that.
Guess this note will be helpful.
If u have custom validator class u will need to check every field manually, ex:
class MyCustomValidator extends Validator {
public function php($data)
{
$valid = true;
$fields = $this->Form()->Fields();
foreach($fields as $field) {
$valid = $valid && $field->validate();
}
// your custom validation
return $valid;
}
}
but if u will extend SilverStripe\Forms\RequiredFields it will work ok:
class MyCustomValidator extends RequiredFields {
public function php($data)
{
$valid = parent::php($data);
// your custom code
return $valid;
}
}
bootstrap form module + norecaptcha works ok without custom validation.
When using a bootstrap form module and using norecaptcha. Validation Error wont show up.
see nocaptcha/lang/en.yml
` en: NocaptchaField:
`