I am attempting to insert a validation symbol (a green check mark) inside a text box once a user fulfills specific criteria. My approach involves using JQuery for implementation. I have made an attempt using Fontawesome icons with the following code, but it does not seem to be effective:
$('#username').append('<i style="display:inline;color: #3a7d34;" class="icon-check-sign"></i>');
I would greatly appreciate any suggestions or alternative ideas.
UPDATE:
The below snippet showcases my HTML code, aiming to insert a checkmark within the textbox
<tr>
<td style="text-align: left">
@Html.LabelFor(m => m.Username, "Username")
</td>
</tr>
<tr>
<td style="padding-left: 5px">
@Html.UsernameFor(m => m.Username,
new
{
@class = "inputClass1 inputClass2",
style = "width:150px",
id = "username",
onkeyup = " return validateUsername() "
})
@Html.ValidationMessageFor(model => model.Username)
</td>
</tr>
Thank you,
WH