I am working on a form that includes input fields, datepickers, and dropdowns. Currently, if the required input fields are left blank upon submission, they are highlighted with a red line. However, I want the datepickers and dropdowns to also be highlighted if not selected.
Here is the code snippet:
<div class="input-section-title">Information</div>
<div layout="row"
layout-align="start start">
<md-datepicker id="date"
ng-model="vm.submissionDate"
md-placeholder="Date*"
required></md-datepicker>
<md-input-container class="form-input-container padded-input md-block"
flex-gt-sm="">
<label>Type*</label>
<md-select id="information-type"
ng-model="vm.type"
required>
<md-option ng-repeat="type in vm.dropdowns.types"
value="{{type}}">
{{type}}
</md-option>
</md-select>
</md-input-container>
<md-input-container class="form-input-container"
flex="15">
<label>NVRA*</label>
<md-select id="information-nlba"
ng-model="vm.code"
required>
<md-option ng-repeat="code in vm.dropdowns.codes"
value="{{code}}">
{{code}}
</md-option>
</md-select>
</md-input-container>
</div>
<div class="input-section-title">Personal Information</div>
<div layout="row" layout-align="start start">
<md-input-container class="form-input-container" flex>
<label>Last Name*</label>
<input id="personal-information-last-name"
ng-model="vm.vitals.last" required>
</md-input-container>
<md-input-container class="form-input-container padded-input" flex>
<label>First Name*</label>
<input id="personal-information-first-name"
ng-model="vm.vitals.first" required>
</md-input-container>
<md-input-container class="form-input-container padded-input" flex>
<label>Middle Name</label>
<input id="personal-information-middle-name"
ng-model="vm.vitals.middle">
</md-input-container>
<md-input-container class="form-input-container" flex="15">
<label>Suffix</label>
<md-select id="personal-information-suffix"
ng-model="vm.vitals.suffix">
<md-option ng-repeat="suffix in vm.dropdowns.suffixes"
value="{{suffix}}">
{{suffix}}
</md-option>
</md-select>
</md-input-container>
</div>