I have created 3 checkbox and i am struggling to make them to communicate with my Jquery button i have created to allow a user an option to select. If one is selected and other one both are, they must when button is clicked should download my feeds as CSV file. I have the logic below i want to share for clear understanding as to what exactly i want to achieve.
$(document).ready(function() {
$("#download").click(function() {
window.location.href = 'https://api.thingspeak.com/channels/899906/feeds.csv?start=2019-11-12%2019:11:12&end=2019-11-13%2019:11:13';
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="temperature">
<label class="custom-control-label" for="temperature">Temperature</label>
</div>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="illuminance">
<label class="custom-control-label" for="illuminance">Illuminance</label>
</div>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="button-state">
<label class="custom-control-label" for="button-state">Button-State</label>
<!---Downloading File using
Jquery with Buttons---->
<div class="form-group"><br>
<div class="col-md-1.9 text-center">
<button id="download" name="download" class="btn btn-warning">Download</button><br>
</div>
</div>