AusDTO / gov-au-ui-kit

MOVED TO https://github.com/govau/uikit/
https://github.com/govau/uikit/
MIT License
19 stars 12 forks source link

Class location for form input error handling #376

Open elisechant opened 8 years ago

elisechant commented 8 years ago

Are we able to move the location of the invalid class from the input to the container div for form fields so I can style the field as well as the input if invalid?

Currently:

<p>
  <label for="textinvalid">An invalid field</label>
  <input name="textinvalid" id="textinvalid" type="text" class="invalid">
</p>

Can it be:

<p class="invalid">
  <label for="textinvalid">An invalid field</label>
  <input name="textinvalid" id="textinvalid" type="text">
</p>

This will give us the most flexibility for styling input behaviour.

Also side note, can you say why the wrapping component is a p rather than a div?