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

[Bug] Input array validations not working at all in forms #6368

Open
manfredipist opened this issue May 2, 2018 · 5 comments · May be fixed by #6370
Open

[Bug] Input array validations not working at all in forms #6368

manfredipist opened this issue May 2, 2018 · 5 comments · May be fixed by #6370

Comments

@manfredipist
Copy link

Coming from [Form Validation] Add Data-Validate Example #2683 I'm struggling with the same problem since, as another user pointed out, the problem hasn't been fixed at all :/

Steps

Setting proper name and date-validate for each input they should be parsed and validated properly according to the doc.

Expected Result

If any of the input didn't pass the validation the form should print the error message we are used to.

Actual Result

Only the first input get validated, the other pass the validation in any case

Version

2.3.1

Testcase

http://jsfiddle.net/92p8fkbb/

@prudho
Copy link

prudho commented May 3, 2018

@hammy2899 this is more a bug than an enhancement. The rule function seem to test three times the first value instead of testing each value one time.

I'll submit a PR shortly to fix this.

@y0hami
Copy link
Member

y0hami commented May 3, 2018

@prudho I see where you're coming from but the validation doesn't have that functionality therefor it would need to be added hence the enhancement.

I will take a look at your PR when I get some time today.

@manfredipist
Copy link
Author

@prudho Hey, I've been testing your fix but it seems not to work properly. When there are multiple array input, each time you try to validate they get validated as a block, what I mean is :

Input1 ->good
Input2 ->bad
Input3 ->bad

I click on "validate button" and also the input1 get marked as bad .

@prudho
Copy link

prudho commented May 3, 2018

Yeah, I see what you mean. Actually I don't know how to deal with that, since the three inputs are handled together in the code...

@hammy2899 you were right, this is more an enhancement than a bug. My PR can only validate all fields of a group, but can't show which field is invalid... Fell free to reject it if it doesn't help at all.

@lubber-de

This comment was marked as spam.

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

Successfully merging a pull request may close this issue.

4 participants