I
I
Imran Guseynov2014-02-18 20:12:38
Bootstrap
Imran Guseynov, 2014-02-18 20:12:38

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>

The question is how to read data from the form on the server if I use the following code
<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

* just take and go to 3 bootstrap does not work.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Krickt, 2014-02-18
@shiza36

But you don’t have to go, take only the radio buttons from there, there is a customizer.

S
Sergey Meketyuk, 2014-02-18
@SergeiMeketyuk

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");
});

E
Eugene, 2014-02-20
@cyber-jet

What will you process? Puff, the post method? View the form array data, a lot will become clear:

<pre>
<?php print_r ($_POST); ?>
</pre>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question