I have the following in my style sheet
#accordion .card button:before {
content: "";
background-image: url(/Images/Shared/greenTick.png);
position: absolute;
left: 16px;
height: 100%;
width: 100%;
background-repeat: no-repeat;
display: none;
}
Its to allow a green tick to appear when needed on the left side of the card in bootstrap.
Its turned off until needed, but how do I use it to display the tick in the following way.
function CheckFormValues() {
if ($('#txtSelectedClient').val().trim() !== '') {
$('#txtSelectedClient').closest('.card').css({ "background-color": "green" });
}
}
So instead of the green background I show the tick. I also tried removing #txtSelectedClient and replacing it with this and it didnt work.
I wanted to use $this as a better method than writing out the line below over and over as below, this is only two examples but this could be repeated 10-15 times.
if ($('#txtSelectedClient').val().trim() !== '') {
$('#txtSelectedClient').closest('.card').css({ "background-color": "#8DC63F" });
}
if (!$.trim($('#servicingOfficeList:empty').html()).length) {
$('#servicingOfficeList').closest('.card').css({ "background-color": "#8DC63F" });
}