I have a set of three styled radio buttons for car rental pickup locations:
<div class="col-md-12 form-group">
<label for="car-rental-pickup-location" class="mb-2">Pickup Location<small class="text-danger">*</small></label><br>
<div class="btn-group my-tab btn-group-toggle nav" data-toggle="buttons">
<a href="#tab-pickup" class="btn btn-outline-secondary flex-fill pudo" data-toggle="tab">
<input type="radio" name="car-rental-pickup-location" id="car-rental-pickup-location-la" value="la" required onfocus="dateCheck();">Los Angeles
</a>
<a href="#tab-pickup" class="btn btn-outline-secondary flex-fill pudo" data-toggle="tab">
<input type="radio" name="car-rental-pickup-location" id="car-rental-pickup-location-sf" value="sf" onfocus="dateCheck();">San Francisco
</a>
<a href="#tab-pickup" class="btn btn-outline-secondary flex-fill pudo" data-toggle="tab">
<input type="radio" name="car-rental-pickup-location" id="car-rental-pickup-location-oc" value="oc" onfocus="dateCheck();">Orange County
</a>
</div>
</div>
Here is a screenshot of the styled radio buttons:
https://i.sstatic.net/B4rLT.png
I am facing an issue where the radio buttons do not update when I reset the form or use JavaScript to check a different option. How can I resolve this issue?
Below is the code snippet of the radio buttons:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<div class="col-md-12 form-group">
<label for="car-rental-pickup-location" class="mb-2">Pickup Location<small class="text-danger">*</small></label><br>
<div class="btn-group my-tab btn-group-toggle nav" data-toggle="buttons">
<a href="#tab-pickup" class="btn btn-outline-secondary flex-fill pudo" data-toggle="tab">
<input type="radio" name="car-rental-pickup-location" id="car-rental-pickup-location-la" value="la" required onfocus="dateCheck();">Los Angeles
</a>
<a href="#tab-pickup" class="btn btn-outline-secondary flex-fill pudo" data-toggle="tab">
<input type="radio" name="car-rental-pickup-location" id="car-rental-pickup-location-sf" value="sf" onfocus="dateCheck();">San Francisco
</a>
<a href="#tab-pickup" class="btn btn-outline-secondary flex-fill pudo" data-toggle="tab">
<input type="radio" name="car-rental-pickup-location" id="car-rental-pickup-location-oc" value="oc" onfocus="dateCheck();">Orange County
</a>
</div>
</div>