Is it possible to perform form fields validation manually, forced?
I have a form. It has a global form validation. Everything works well if user submits data.
But I want to trigger validation before form is displayed to the user - show errors before submit.
Tried to submit using $form->submit([])
method but it doesn't trigger form fields validation.
Any ideas on this issue? Did I something wrong?
Do you need to validate a data only by form? Doesn't a validator service work for you?
Like
$violations = $this->get('validator')->validate($entity);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With