laravel-form-builder
laravel-form-builder copied to clipboard
Form is valid even if repeated fields are not the same
I use Laravel 5.6 and your package, but I can't show an error when repeated fields are not the same.
I have 2 repeated fields in my form (email and password), I put different passwords but
$form->isValid()
returns true. Do I need to write my own validation ?
My password form is :
])->add('password', 'repeated', [
'type' => 'password',
'second_name' => 'password_confirmation',
'first_options' => [
'template' => 'layout.forms.text_right',
'rules' => 'required',
'label' => __('customer.password'),
],
'second_options' => [
'template' => 'layout.forms.text_right',
'rules' => 'required',
'label' => __('customer.password_confirmation'),
],
])
Thanks
Yeah, you need to write your own validation, there's no default support for that. This field type was added before the validation feature, so we should maybe update it to support that.