It's up to you to choose suitable icons from Google material design icons for the
feedback icons. The following table is just an example of three icons taken from the
set:
Field status
Icon
Valid
Invalid
Being validated
As you see, each Google material design icon uses pre-defined content instead of a
different CSS class. Meanwhile, the icon option only
accepts CSS classes that are added to the icon based on the field validity.
The next section introduces two approaches to solve this problem.
Defining icon content by CSS
By using the :after CSS selector, we can indicated content of icons as
following:
Lastly, you just set the icons for each status of field:
In this approach, we set the same material-icons class for all icons:
In order to update the content of icon based on the field validity status, we can handle
the status.field.fv event that is triggered
whenever the field status is updated:
Tip: For a given field, we can retrieve the icon
element via $field.data('fv.icon') as seen in the sample code above