Sara012 oh easy to do.
this is php guide for form validation.
if received data is invalid, echo to client an image like red cross image or something like.
if you want to echo same document but with changing style, place this in head tag :
if(validate) echo '<link href="validate.css" rel="stylesheet"></link>'
else echo '<link href="invalidate.css" rel="stylesheet"></link>'.
but hackers can send invalid data.
Sara , can't get what you are talking about.
What class, and how it related with input?
if you want to style differently like day/night mode why don't you use JS for it?
any way, you can change class of any container using PHP.