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> The process of talent mapping involves creating a comprehensive and detailed analysis of future industry…
Introduction: The digital landscape is always evolving, and if there is one thing you can…
Forget all the big fancy words and tech hype around “Artificial Intelligence” for now. The…
Solar panels work by converting the solar energy received from the sun into usable electric…
In today’s digital-first economy, your website is often the first impression your business makes. Whether…
Dubai’s digital landscape is highly competitive, making it essential for businesses to work with the…