Answer the question
In order to leave comments, you need to log in
How to get the bootstrap radio button on the server?
In the 2nd version of bootstrap, we are offered the following code to display the radio button
<div class="btn-group" data-toggle="buttons-radio">
<button type="button" class="btn btn-primary">Left</button>
<button type="button" class="btn btn-primary">Middle</button>
<button type="button" class="btn btn-primary">Right</button>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<button type="button" name="pol" value='man' class="btn btn-primary">М</button>
<button type="button" name="pol" value='woman' class="btn btn-primary">Ж</button>
</div
Answer the question
In order to leave comments, you need to log in
But you don’t have to go, take only the radio buttons from there, there is a customizer.
Maybe I did not understand the question, but the selected button has the 'active' class, then when submitting the form, simply select the button that has this class and take the value value.
$(function() {
var btnGroup = $("#you_btn_group"),
selectedRadioBtn = btnGroup.find(".btn.active");
cansole.log(selectedRadioBtn.attr("value");
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question