We recommend the stacking of labels/form fields in the forms tutorial – I’m unsure if we need a whole page explaining this. I think we should make this more clear in the tutorial, we have a styling page for other tutorials and there is nothing saying we couldn't have one in the forms tutorial as well.
Floating labels are problematic for many people with disabilities and should be avoided. I don’t feel comfortable to promote them as they are solving a perceived problem that does not exist. (see also “Floating labels are problematic” by Adam Silver)
If we really, really have to keep them, we need to give more information on what is done and why and how to ensure to not run into problematic issues.
var classname = document.getElementsByClassName("field"); – The variable actually does not hold class names but references to the fields, so rename as fields or similar.
The demo breaks when JavaScript is not loading as the label is then displayed above the input field, even when the input field receives focus.
We recommend the stacking of labels/form fields in the forms tutorial – I’m unsure if we need a whole page explaining this. I think we should make this more clear in the tutorial, we have a styling page for other tutorials and there is nothing saying we couldn't have one in the forms tutorial as well.
Floating labels are problematic for many people with disabilities and should be avoided. I don’t feel comfortable to promote them as they are solving a perceived problem that does not exist. (see also “Floating labels are problematic” by Adam Silver)
If we really, really have to keep them, we need to give more information on what is done and why and how to ensure to not run into problematic issues.
var classname = document.getElementsByClassName("field");
– The variable actually does not hold class names but references to the fields, so rename asfields
or similar.The demo breaks when JavaScript is not loading as the label is then displayed above the input field, even when the input field receives focus.