hmrc / component-library-template

Template files for HMRC's component library
1 stars 16 forks source link

Make elements in modifiers unique via a handlebars helper #15

Closed feedmypixel closed 8 years ago

feedmypixel commented 8 years ago

In the instance of the errors section we have multiple modifiers using markup that includes a label with an input. Due to the for attribute on the label pointing to the id on the input all inputs on the page point to the initial label in the markup example.

It would be handy to provide a count which could be appended to the label for attribute and the input id so each label refers to the correct input

id="id_name_{{count}}"
rpowis commented 8 years ago

You don't need the for attribute on the label if it's wrapping the input...

https://www.w3.org/WAI/tutorials/forms/labels/#associating-labels-implicitly

feedmypixel commented 8 years ago

good point - thats an easy fix :+1: