<form action="" method="post">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" class="form-control valid">
<div class="valid-feedback">Looks good!</div>
<div class="invalid-feedback">Please choose a username.</div>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" class="form-control invalid">
<div class="valid-feedback">Email is valid!</div>
<div class="invalid-feedback">Please enter a valid email address.</div>
</div>
<button type="submit">Submit</button>
</form>
<style>
.form-control { width: 100%; padding: 10px; margin-top: 5px; }
.valid { border: 2px solid green; }
.invalid { border: 2px solid red; }
.valid-feedback, .invalid-feedback { display: none; }
.valid:focus ~ .valid-feedback { display: block; }
.invalid:focus ~ .invalid-feedback { display: block; }
</style>
How do I avoid rehashing overhead with std::set in multithreaded code?
How do I find elements with custom comparators with std::set for embedded targets?
How do I erase elements while iterating with std::set for embedded targets?
How do I provide stable iteration order with std::unordered_map for large datasets?
How do I reserve capacity ahead of time with std::unordered_map for large datasets?
How do I erase elements while iterating with std::unordered_map in multithreaded code?
How do I provide stable iteration order with std::map for embedded targets?
How do I provide stable iteration order with std::map in multithreaded code?
How do I avoid rehashing overhead with std::map in performance-sensitive code?
How do I merge two containers efficiently with std::map for embedded targets?