function custom_validate(sender, args)
{
    args.IsValid = args.Value != "";
    
    // if in easy mode, we set the associated table row colour
    var tableRow = sender.parentNode; // div
    if (tableRow != null) 
    {
        tableRow = tableRow.parentNode; // td
        if (tableRow != null) 
        {
            tableRow = tableRow.parentNode; // tr
        }
    }

    if (tableRow != null && tableRow.tagName.toLowerCase() == "tr") 
    {
        if (!args.IsValid)
        {
            tableRow.style.backgroundColor = "#f7dac9";
        }
        else
        {
            tableRow.style.backgroundColor = "";
        }   
    }
} 
