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>
Cryptocurrency has transformed from a digital experiment into a global financial force in just over…
Introduction Layoffs have always been a part of corporate life, but the way they’re happening…
Relocating is often an exciting milestone, whether you’re starting a new job, heading to college,…
When you select cheap domain names, it can have a significant impact on the success…
Shared hosting struggles to keep up the performance commitment. Therefore, low-cost VPS hosting is an…
Does your melasma return every summer despite months of treatment? Melasma appears as brown or…