I have the following form.
.form-control{
border-radius: 100vw;
margin-bottom: .75rem;
text-decoration: none;
appearance: none;
padding: 0.375rem 1.5rem !important;
position: relative;
}
.form-control:required::after{
content: '*';
font-size: 1.5rem;
color: #417A5F;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 10px;
}
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div id="modalForm">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5>Form</h5>
</div>
<div class="modal-body">
<input type="text" class="form-control form-input" id="fname" placeholder="First Name" required>
<input type="text" class="form-control form-input" id="lname" placeholder="Last Name" required>
<select name="gender" class="form-control" id="gender" required>
<option value="Null" selected hidden>Gender</option>
<option value="M">Male</option>
<option value="F">Female</option>
</select>
<input type="date" name="dob" id="dob" class="form-control" placeholder="Date of Birth" required>
<input type="tel" name="phone" id="phone" class="form-control" placeholder="Phone Number" required>
<input type="email" name="email" id="email" class="form-control" placeholder="Email" required>
<input type="tel" name="zipcode" id="zipcode" class="form-control" placeholder="Zip Code">
<input type="text" name="street" id="street" class="form-control" placeholder="Address" required>
<input type="text" name="city" id="city" class="form-control" placeholder="City" required>
<select name="state" class="form-control" id="state" required>
<option value="Null" selected hidden>State</option>
</select>
</div>
<div class="modal-footer">
<button class="btn btn-primary">Button</button>
</div>
</div>
</div>
</div>
And currently I have the problem with the :required selector, because apparently it only recognizes one input of all those that are also in required. What could be happening?