I'm having some difficulty setting the value of a hiddenfield using a Bootstrap radio button. Below is the code for the button group with the radio buttons and the hiddenfield.
<div class="myRow">
<div class="smallCol">
<div class="btn-group hiddenRFIDValue" data-toggle="buttons">
<label class="btn btn-default">
<input type="radio" class="btn" name="options" id="alwaysRFID" autocomplete="off">
Always
</label>
<label class="btn btn-default">
<input type="radio" class="btn" name="options" id="neverRFID" autocomplete="off">
Never
</label>
<label class="btn btn-default">
<input type="radio" class="btn" name="options" id="sometimesRFID" autocomplete="off">
Sometimes
</label>
</div>
</div>
</div>
</div>
<asp:HiddenField ID="hiddenRFIDValue" runat="server" />
Below is the script I have been trying to use to set the value.
<script>
$(".hiddenRFIDValue .btn").click(function () {
// Whenever a button is clicked, set the value of the hidden field
$("#hiddenRFIDValue").val($(this).text());
});
</script>
Any assistance with this issue would be greatly appreciated. Thank you.