Would like to have 3 dropdown lists with identical values. The first dropdown must be selected, while the other two are optional.
All three dropdowns will have the same options. If a user selects an option in dropdown 1, it will become disabled for the remaining dropdowns. Once all three dropdowns are selected, the chosen values will be displayed as text on the same page. This text will then be saved into the database under the field "selected_option."
Struggling with this Angular concept as a beginner. Any guidance would be appreciated :(
The following code is from my view:
<div class="row form-group">
Selected:
Dropdown 1 : <select class="form-control" ng-model="selected_option[0]"
ng-options="option.value as option.text for option in params">
</select>
</div>
<div class="row form-group">
Selected:
Dropdown 2 : <select class="form-control" ng-model="selected_option[1]"
ng-options="option.value as option.text for option in params">
</select>
</div>
<div class="row form-group">
Selected:
Dropdown 3 : <select class="form-control" ng-model="selected_option[2]"
ng-options="option.value as option.text for option in params">
</select>
{{ selected_option }}
</div>
This part belongs to my controller:
$scope.selected_option = [];
$scope.params= [
{value: "A", text: "A"},
{value: "B", text: "B"},
{value: "C", text: "C"},
];