I would use the function
xfa.host.messageBox ( "BLACK"" , "MY COLOR", 3 , 1 ) ;
to display an Alert message if the text1 field is equal to "BLACK"
or
to display an Alert message if the text1 field is equal to "YELLOW"
or
to display an Alert message if the text1 field is equal to "GRREN"
Tks