Text fields allow user input. The border should light up simply and clearly indicating which field the user is currently editing. You must have a .input-field
div wrapping your input and label. This is only used in our Input and Textarea form elements.
The validate class leverages HTML5 validation and will add a valid
and invalid
class accordingly. If you don't want the Green and Red validation states, just remove the validate
class from your inputs.
If you are having trouble with the labels overlapping prefilled content, Try adding class="active"
to the label.
You can also call the function M.updateTextFields();
to reinitialize all the Materialize labels on the page if you are dynamically adding inputs.
You can add an icon prefix to make the form input label even more clear. Just add an icon with the class prefix
before the input and label.
You can add custom validation messages by adding either data-error
or data-success
attributes to your helper text element.