Below is an attempt I have created to use the CSS content
property to add the tick mark to show on valid required fields however it has not been successful.
As I haven’t really seen it done this way, is it just not possible to do it like this? Would it be more efficient to just use JavaScript?
I would like to hear about peoples’ opinions on the way I should implement this feature for user feedback.
input[type=text]:valid {
border: 1px solid green;
}
input[type=text]:valid:after {
content: '✓';
color: green;
}
<p>Username:</p>
<input type="text" placeholder="Username" name="username" pattern="^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$" title="Must Include Characters And Numbers only" required>
This essentially answered my question: http://codepen.io/brentrobbins/pen/beexQR