-
Notifications
You must be signed in to change notification settings - Fork 949
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
Input names input_name
and input_name[]
should be treated as same name.
#3577
Comments
I am afraid this will lead to further pitfalls down the road because anything that considers the name, including browsers features, will not consider Either handle the missing field on the server or add:
And discard empty values on the server. |
I ended up doing both: I added an empty But now I'm wondering: is there a way to disable the appending of In this case, the presence of these |
There is not, but we could probably add something to opt-out. |
That would be greatly appreciated. Perhaps a I could help developing this. |
opinions? @chrismccord @josevalim |
👋
Environment
Elixir 1.17.2 (compiled with Erlang/OTP 27)
1.7.18
1.0.1
Chrome
yes
Actual behavior
In my form, I have a multi-select input accompanied by an empty
hidden
input, which I use to detect when no items in the select have been chosen. This allows me to empty the array field associated with thatselect
. Here's an example of the structure:When I edit any input in the form, this
select
field is marked as "used" and shows an error.After debugging the new
live_view/view.js
file, I discovered that, in this loop, thehidden
input and theselect
are treated as different fields because they have different names:Expected behavior
This inputs should be treated as the same input, perhaps changing this line:
could work.
The text was updated successfully, but these errors were encountered: