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

Registration form labels aren't linked to input fields #315

Closed
zedtux opened this issue Dec 12, 2017 · 5 comments
Closed

Registration form labels aren't linked to input fields #315

zedtux opened this issue Dec 12, 2017 · 5 comments

Comments

@zedtux
Copy link

zedtux commented Dec 12, 2017

I'm completely new to Elixir/Phoenix and coherence, and I have created a new phoenix project and added coherence and all is working fine.

Now I'm writing tests and I need to login before to do whatever else, but my test is failing stating that the label for isn't matching any fields on the page.

Have a closer look at the source code of the page I found out that the label for contains registration_Name while the input field as its id attribute to registration_name.

I think the issue comes from the required_label function which should receive and pass the field to the label call.

I have updated the form.eex file replacing the required_label with:

    <%= label f, :name, class: "control-label" do %>
      <%= dgettext("coherence", "Name") %>
    <% end %>

then the label is now well connected to the field.

@smpallen99
Copy link
Owner

Thanks for reporting. Would be a nice PR for someone new to the project.

@zedtux
Copy link
Author

zedtux commented Dec 16, 2017

As I’m really new to the Elixir world, I wasn’t sure enough to open a PR, but now I have you confirmation, I’lol open it. Thank you.

@sivagollapalli
Copy link
Contributor

I am really new to elixir world. My guess is by removing humanize function from

would solve this problem I think?

@marnen
Copy link

marnen commented Mar 1, 2018

What seems to work for me is to change dgettext("coherence", "Password") to dgettext("coherence", "password"). The humanize function still capitalizes the display text, but makes the actual for attribute lowercase to match the actual field. There's probably a better solution, though.

smpallen99 added a commit that referenced this issue Apr 15, 2018
[#315] Registration labels inconsistency
@zedtux
Copy link
Author

zedtux commented Jul 18, 2018

Thank you @smpallen99

@zedtux zedtux closed this as completed Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants