-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
[Formvalidation] Input array validations should respect each single field on its own #387
[Formvalidation] Input array validations should respect each single field on its own #387
Conversation
…support input arrays
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🤔 I think, I forgot one case, will check and possibly add another commit in 2 hours approx .. Don't merge yet |
… is always only 1 value set
Alright, i had to fix the behavior to work with radio buttons as before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@lubber-de |
@morkpl Thanks, I'll investigate |
maybe i can ask
this is fixed now? because im using actual release (2.8 ) and i have the same problem. anyway, thanks for such a great framework |
@morkpl |
@lubber-de thanks to you for the reply. |
Description
If a form uses array inputs by appending brackets to their names (
name="myfield[]"
) the validation on those fields was always done for the whole field group. Means, if the first field was valid, it validated for the whole group which is wrong.This behavior is now fixed, so even if multiple input fields have the same name to act as array inputs, the validation is done on each field separately and also the error class is set/removed to each field individually.
@prudho was already providing a PR for that in SUI some time ago, but the individual error display handling was missing there.
Testcase
Before
http://jsfiddle.net/a1cnph4f/
Try to click on submit to invalidate each the form. If any of the multiple fields is invalid it won't get the error class.
After
http://jsfiddle.net/a1cnph4f/1/
Correct behavior now: error class for each invalid field
I also put a normal (single) field into the fiddle to make sure the usual behavior is still working.
Special testcase: Radiobuttons are also working (which need the behavior)
http://jsfiddle.net/47Lysubr/
Screenshots
Before
After
Closes
Semantic-Org/Semantic-UI#6368
Semantic-Org/Semantic-UI#2683
Semantic-Org/Semantic-UI#2688
Semantic-Org/Semantic-UI#5469
Semantic-Org/Semantic-UI#829