Within my form, I have two select boxes that allow users to move items between them. Let's call them SelectBox1 and SelectBox2. I move all available options from SelectBox1 to SelectBox2. When I try to submit the form, I check for validity. However, if I move all options from SelectBox1 to SelectBox2, it triggers the $valid flag to false, preventing me from proceeding. Is there a way in angularJS to prevent SelectBox1 from affecting the validation check with $valid?
<select multiple="multiple" id="selectBox1" class="form-control" ng-model="available" ng-options="role as role.Name for role in availableRoles"> </select>
<select multiple="multiple" id="selectBox2" class="form-control" required onchange="GetFunctionWisePrivileges()" ng-model="selected" ng-options="role as role.Name for role in selectedRoles"></select>
It's important to note that SelectBox1 is optional, while SelectBox2 is required.