I'm working on a form using Bootstrap 4 and I need to display validation errors. Specifically, I want the text field with an input-group
for the password to have the same styling as the Username field when there is an error (i.e., red border and background color applied to the full width). Is there a way to make this happen?
https://i.sstatic.net/qil8y.png
<div class="form-group">
<label>Username</label>
<input class="form-control input-validation-error" type="text" id="Input_UserName" name="Input.UserName" value="">
<span class="text-danger field-validation-error">Username is a required field</span>
</div>
<div class="form-group">
<label>Password</label>
<div class="input-group">
<input type="password" class="form-control border-right-0 input-validation-error" data-password-input="toggle-password-view" id="Input_Password" name="Input.Password">
<div class="input-group-append">
<span class="input-group-text border-left-0 bg-transparent" data-view="toggle-password">
<span id="password-toggle" class="small">show</span>
</span>
</div>
</div>
<span class="text-danger field-validation-error">Password is a required field</span>
</div>