Using HTML5 required style you can validate your form and show error. But sometimes you need to give a style like keep the color red for error or green on success. Here’s how to use CSS3 required.
<!DOCTYPE html>
<html>
<head>
<title>CSS3 styles</title>
<style type="text/css">
input[type="checkbox"]:required:invalid + label { color: red; }
input[type="checkbox"]:required:valid + label { color: green; }
</style>
</head>
<body>
<form>
...
<p>
<input id="agree" name="agree" type="checkbox" required>
<label for="agree">I accept the <u>Terms and Conditions</u></label>
</p>
...
</form>
</body>
</html> Are you an owner of a small business who’s trying to come up with ways…
Introduction When patients bring me their lab reports, the confusion is almost always the same.…
Are you excited about remodeling your house after a long time? Perhaps if you're planning…
The practice of yoga teaches us to be present, patient and mindful of our decisions.…
As we are once again allowed to go outside, nearly everyone is planning to go…
How do you find a cleaning company that will take excellent care of your business…