There is missing code in forms.php that assign invalidCLASS value...
if(IsSet($arguments["STYLE"]))
$input["STYLE"]=$arguments["STYLE"];
if(IsSet($arguments["InvalidSTYLE"]))
$input["InvalidSTYLE"]=$arguments["InvalidSTYLE"];
/* start of missed code */
if(IsSet($arguments["InvalidCLASS"]))
$input["InvalidCLASS"]=$arguments["InvalidCLASS"];
/* end of missed code */
if(IsSet($arguments["CLASS"]))
$input["CLASS"]=$arguments["CLASS"];