SELECTED ANSWER
replied on December 6, 2017
Hey,
Its a bit of a pain to do as each of those fields have a different way of determining if they are "filled". I threw this together for you, should help getting you stared.
$(document).ready(function() {
function colorFields()
{
$('input[type=text]').each(function() {
console.log($(this).val());
if($(this).val() != "")
{
$(this).attr('style', 'background-color: #ff0000 !important;');
}
else
{
$(this).attr('style', '');
}
});
$('textarea').each(function() {
if($(this).text() != "")
{
$(this).attr('style', 'background-color: #ff0000 !important;');
}
else
{
$(this).attr('style', '');
}
});
$('input[type=radio]').each(function() {
if($(this).is(":checked"))
{
console.log('test');
$(this).parents('span').attr('style', 'background-color: #ff0000 !important;');
}
else
{
$(this).parents('span').attr('style', '');
}
});
$('input[type=checkbox]').each(function() {
if($(this).is(":checked"))
{
console.log('test');
$(this).parents('span').attr('style', 'background-color: #ff0000 !important;');
}
else
{
$(this).parents('span').attr('style', '');
}
});
$('select').each(function() {
console.log($(this).val());
if($(this).val() != "")
{
$(this).attr('style', 'background-color: #ff0000 !important;');
}
else
{
$(this).attr('style', '');
}
});
}
$(document).on("lookupcomplete", function (event) {
colorFields();
});
});
Hope it helps :)