I’m following documentation phx-feedback-for since I have:
Failing to add the
phx-feedback-for
attribute will result in displaying error messages for form fields that the user has not changed yet (e.g. required fields further down on the page).
And I tried exactly as documentation states, and some variation but did not achieved the desired result, i.e. error messages stll appear for unchanged fields.
Inspection of error tags after I make a change in the first field:
error user_last_name: {:safe,
[
60,
"span",
[
[32, "class", 61, 34, "invalid-feedback", 34],
[32, "phx-feedback-for", 61, 34, "last_name", 34]
],
62,
[[[], "can" | "'"] | "t be blank"],
60,
47,
"span",
62
]}
error user_email: {:safe,
[
60,
"span",
[
[32, "class", 61, 34, "invalid-feedback", 34],
[32, "phx-feedback-for", 61, 34, "email", 34]
],
62,
[[[], "can" | "'"] | "t be blank"],
60,
47,
"span",
62
]}
error user_terms_conditions: {:safe,
[
60,
"span",
[
[32, "class", 61, 34, "invalid-feedback", 34],
[32, "phx-feedback-for", 61, 34, "terms_conditions", 34]
],
62,
"must be accepted",
60,
47,
"span",
62
]}
How it looks:
In this example I used phx_feedback_for: field
but I also tried phx_feedback_for: input_name(form, field)
as stated in documentation and similar but that’s obviously not the issue.
What am I missing here?