I'm integrating jquery-validation with glyphicons. Basically when the user inputs something correctly I'd like to see the glyphicon inside the input box, like so:
But I'd like it to become something that is triggered via the CSS :after
property. I can't get anything to work, even with content set to "QDQWDQWD" or some random string. The :after
element doesn't appear in Inspect element. Am I doing the right approach or can this be solved easier with another solution? (BTW, this is in Rails, if that add something.)
Markup:
<div class="form-group">
<input class="form-control valid" id="user_email"
name="user[email]" placeholder="Email-Address"
size="30" type="email" value="a@aa5305.com">
</div>
SASS:
input.valid{
color: green; /* This works. The text does become green */
&:after {
/* content: "<span class="glyphicon glyphicon-ok glyphicon-star"></span>";*/
content: "QDQWDW";
color: green;
font-weight:bold;
font-size: 18px;
position: absolute;
right: 12px;
top: 12px;
}
}