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

Form is valid even if repeated fields are not the same #447

Open
vince83110 opened this issue Aug 3, 2018 · 1 comment
Open

Form is valid even if repeated fields are not the same #447

vince83110 opened this issue Aug 3, 2018 · 1 comment

Comments

@vince83110
Copy link
Contributor

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

@kristijanhusak
Copy link
Owner

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.

Eloar added a commit to Eloar/laravel-form-builder that referenced this issue Apr 13, 2023
- adding `same:` rule to first field of repeated type
- proper handling of rules on repeated field itself and first subfield
Eloar added a commit to Eloar/laravel-form-builder that referenced this issue Apr 13, 2023
- adding `same:` rule to first field of repeated type
- proper handling of rules on repeated field itself and first subfield
Eloar added a commit to Eloar/laravel-form-builder that referenced this issue Apr 13, 2023
- adding `same:` rule to first field of repeated type
- proper handling of rules on repeated field itself and first subfield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants