How can I display the state field only when the user selects United States in the country field, and hide it otherwise? Here is the code snippet from my cshtml page:
<div class="form-group col-sm-4 mt-4">
<label asp-for="Form.Country" class="control-label"></label>
<select asp-for="Form.Country" class="form-control">
<option disabled selected>Choose your Country</option>
<option>Canada</option>
<option>United States</option>
<option>Mexico</option>
</select>
<span asp-validation-for="Form.Country" class="text-danger"></span>
</div>
<div class="form-group col-sm-4 mt-4">
<label asp-for="Form.State" class="control-label"></label>
<select asp-for="Form.State" asp-items="Model.States" class="form-select">
<option disabled selected>Choose your State</option>
</select>
<span asp-validation-for="Form.State" class="text-danger"></span>
</div>
<div class="form-group col-sm-4 mt-4">
<label asp-for="Form.City" class="control-label"></label>
<input asp-for="Form.City" class="form-control" />
<span asp-validation-for="Form.City" class="text-danger"></span>
</div>
I have looked into solutions involving JS, but I am not comfortable with it at this time. Is there a way to achieve this using razor or possibly integrate a blazor component or apply CSS?