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

Array not validating. #2046

Closed
shankhadevpadam opened this issue Aug 17, 2017 · 4 comments
Closed

Array not validating. #2046

shankhadevpadam opened this issue Aug 17, 2017 · 4 comments
Labels
name-attribute stale Used to mark stale issues

Comments

@shankhadevpadam
Copy link

i have the dynamic input like below how to validate like this. Only first field is validate

<input type="text" name="arrival_time[]" required>
<input type="text" name="arrival_time[]" required>
<input type="text" name="arrival_time[]" required>
@Arkni
Copy link
Member

Arkni commented Aug 31, 2017

The name attribute must be unique to the form, as this is how the plugin keeps track of all input elements. However, it is allowed to use the same name for radio buttons and checkboxs.
So each group of radio or checkbox elements will share the same name since the value of this grouping represents a single piece of the form data.

They were many requests in the past from the community to add support for it, but the lack for time and/or people who are willing to implement it results in what you see now.

I would like to work on it, but my current situation doesn't help with that. So I promise nothing.

@aivils
Copy link

aivils commented May 29, 2018

Run in same trouble. Ruby On Rails for parent-children relations will produce large count of equal names in the form:

<input name="person[custom_field_values_attributes][][id]">
<input name="person[custom_field_values_attributes][][text_value]">
<input name="person[custom_field_values_attributes][][id]">
<input name="person[custom_field_values_attributes][][text_value]">

HTML IDs are different.

@aivils
Copy link

aivils commented May 29, 2018

I manually applied this #2000
And it works for me.

@stale
Copy link

stale bot commented Jul 28, 2018

This issue/proposal has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up.
Thank you for contributing :)

@stale stale bot added the stale Used to mark stale issues label Jul 28, 2018
@stale stale bot closed this as completed Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
name-attribute stale Used to mark stale issues
Projects
None yet
Development

No branches or pull requests

3 participants