Changing field color based on an ajax onChange event

I have an ajax event onChange which subtract the value of field A from the value of field B and put this value in field C. What I am trying to achieve now is to put both fields in red if A > B.
Is there a way to achieve this?
So far I used sc_error_message without a message to display, which put the B field in red. (By the way, I thought sc_error_message would prevent insert?)
I have read it could be done with CSS but, I do not know CSS and I am still new to scriptcase, so I could not find how to use css script in scriptcase.

In the end, I wish to have both fields in red in the event that A > B and to prevent insert and/or update when A > B.
I might be going about it the wrong way, so any idea is welcome.