I have created first dropdown which returns a bit. It is either Outbound or Inbound and based on that selection I need to enable the respective further Outbound or Inbound dropdown. It means one dropdown will remain disabled.
<div class="form-group" id="type">
<label class="control-label col-md-2">@Localiser["Outbound"] / @Localiser["Inbound"]</label>
<div class="col-md-10">
<select id="outboundInboundType" name="outboundInboundType" asp-items="@await SelectLists.OutboundInboundTypes()" class="form-control"></select>
</div>
</div>
```
Based on the selection of above code I need to open Either 'Outbound' dropdown shown below
```
<div class="form-group" id="claimOutbound">
<label asp-for="ClaimStatus" class="col-md-2 control-label"></label>
<div class="col-md-10">
<select asp-for="ClaimStatus" class="form-control" asp-items="@await SelectLists.ClaimStatusTypes()"></select>
<span asp-validation-for="ClaimStatus" class="text-danger"/>
</div>
</div>
```
Or Inbound Dropdown below
```
<div class="form-group" id="claimInbound">
<label asp-for="ClaimStatus" class="col-md-2 control-label"></label>
<div class="col-md-10">
<select asp-for="ClaimStatus" class="form-control" asp-items="@await SelectLists.InboundClaimStatusTypes()"></select>
<span asp-validation-for="ClaimStatus" class="text-danger" />
</div>
</div>
```
I need to achieve this using Jquery, I have tried using the ajax call but it is not working
2
Answers
You can try this code:
Here is a working solution.