bootstrap btn-group radio buttons not working on live server - html

I am using bootstrap btn-group class for radio buttons.They are not working on live server.My site is under development example.com .Although they work on a separate html page.
<div class="row">
<section class="col-lg-2 col-xs-3">
<label>Gender:</label></section>
<section class="col-lg-4 col-xs-8">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary control-label input-group">
<input type="radio" name="gender" id="option2" autocomplete="off" value="male">Male
</label>
<label class="btn btn-primary ">
<input type="radio" name="gender" id="option3" autocomplete="off" value="female" checked> Female
</label>
</div>
</section>
</div>

$(document).ready(function(){
$('.gender').on('click', function() {
$('.checked').removeClass('checked');
$(this).addClass('checked');
});
});
#import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
.checked {
background-color: #286090;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="row">
<section class="col-lg-2 col-xs-3">
<label>Gender:</label>
</section>
<section class="col-lg-4 col-xs-8">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary control-label input-group gender">
<input type="radio" name="gender" id="option2" autocomplete="off" value="male">Male
</label>
<label class="btn btn-primary gender">
<input type="radio" name="gender" id="option3" autocomplete="off" value="female" checked> Female
</label>
</div>
</section>
</div>

.btn > input[type="radio"] {
display: none;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="row">
<section class="col-lg-2 col-xs-3">
<label>Gender:</label></section>
<section class="col-lg-4 col-xs-8">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary control-label input-group">
<input type="radio" name="gender" id="option2" autocomplete="off" value="male">Male
</label>
<label class="btn btn-primary ">
<input type="radio" name="gender" id="option3" autocomplete="off" value="female" checked> Female
</label>
</div>
</section>
</div>
Add
.btn > input[type="radio"] {
display: none;
}
in your css

Related

Hiding Display of the actual radio button using Bootstrap

I am trying to get on a form displayed using a modal class.
this radio toggle button output:
However, I am ending up getting instead where the radio button is displayed on the top and the alignment gets disturbed.
This undesirable output:
Here is my code:
<div class = "modal-body">
<form>
<div class = "row form-group">
<label class = "col-sm-2 form-check-label" for = "guestoptions"> Number of Guests</label>
<div class="form-check form-check-inline ">
<input class="form-check-input ml-3" type="radio" name="guestoptions" id="guest1" value="option1">
<label class="form-check-label" for="guest1">1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="guestoptions" id="guest2" value="option2">
<label class="form-check-label" for="guest2">2</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="guestoptions" id="guest3" value="option3">
<label class="form-check-label" for="guest3">3</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="guestoptions" id="guest4" value="option4">
<label class="form-check-label" for="guest4">4</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="guestoptions" id="guest5" value="option5">
<label class="form-check-label" for="guest5">5</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="guestoptions" id="guest6" value="option6">
<label class="form-check-label" for="guest6">6</label>
</div>
</div>
<div class = "row form-group">
<label class = "col-sm-2 form-check-label" for = "section">Section</label>
<input type="radio" class="btn-check" name="section" id="option1" autocomplete="off" checked>
<label class="btn btn-success" for="option1">Non-smoking</label>
<input type="radio" class="btn-check" name="section" id="option2" autocomplete="off">
<label class="btn btn-danger" for="option2">Smoking</label>
</div>
<div class=" row form-group">
<label class = "col-sm-2" for="dateandtime">Date and Time</label>
<div class = "col"><input type="date" class="form-control" id="dateandtime" name = "Date" placeholder="Enter Date"></div>
<div class = "col"><input type="time" class="form-control" id="dateandtime" name = "Time" placeholder="Enter Time"></div>
</div>
<button class = "btn btn-secondary offset-sm-2" style = "position: relative" data-dismiss="modal">Cancel</button>
<button class = "btn btn-primary offset-sm-2 " style = "position: relative">Reserve</button>
</form>
Bootstrap v4
You can add data-toggle="buttons" to a .btn-group element and add .btn-group-toggle to style the radio inputs. Check the docs for more information.
<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.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-outline-success active">
<input
type="radio"
class="btn-check"
name="section"
id="option1"
autocomplete="off"
checked
/>
Non-smoking
</label>
<label class="btn btn-outline-danger">
<input
type="radio"
class="btn-check"
name="section"
id="option2"
autocomplete="off"
/>
Smoking
</label>
</div>
Bootstrap v5
You can use radio button groups.
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" />
<div class="btn-group" role="group" aria-label="section preference">
<input
type="radio"
class="btn-check"
name="section"
id="option1"
autocomplete="off"
checked
/>
<label class="btn btn-outline-success" for="option1">
Non-smoking
</label>
<input
type="radio"
class="btn-check"
name="section"
id="option2"
autocomplete="off"
/>
<label class="btn btn-outline-danger" for="option2">
Smoking
</label>
</div>

align button in horizontal center

I am trying to align a check box and a submit button in the center of a simple form
I tried doing the same using "mx-auto" class.
But it is not working
How do I align my submit Button, Check box in middle or in right side?
<div class="container">
<h3>Please Login</h3>
<form #userForm="ngForm">
<div class="form-group">
<div class="form-floating mb-3">
<input type="email" class="form-control" id="email" placeholder="name#example.com">
<label for="email">Email address</label>
</div>
</div>
<div class="mx-auto">
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="remember-me" checked>
<label class="form-check-label" for="remember-me">
Remember Me
</label>
</div>
</div>
</div>
<div id="submit" class="mx-auto">
<button type="button" type="submit" class="btn btn-primary">LOGIN</button>
</div>
</form>
</div>
Here is the output :
Use this, you can handle it separately
<div class="container">
<h3>Please Login</h3>
<form #userForm="ngForm">
<div class="form-group">
<div class="form-floating mb-3">
<input type="email" class="form-control" id="email" placeholder="name#example.com">
<label for="email">Email address</label>
</div>
</div>
<div class="row">
<div class="mx-auto">
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="remember-me" checked>
<label class="form-check-label" for="remember-me">
Remember Me
</label>
</div>
</div>
<div class="form-group">
<button type="button" type="submit" class="btn btn-primary">LOGIN</button>
</div>
</div>
</div>
</form>
</div>
If you add the text-center class to your container, everything inside will be aligned center.
See Demo below:
<!-- CSS -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2"
crossorigin="anonymous"
/>
<div class="container text-center"> <!-- text-center here -->
<h3>Please Login</h3>
<form #userForm="ngForm">
<div class="form-group">
<div class="form-floating mb-3">
<input
type="email"
class="form-control"
id="email"
placeholder="name#example.com"
/>
<label for="email">Email address</label>
</div>
</div>
<div class="mx-auto">
<div class="form-group">
<div class="form-check">
<input
class="form-check-input"
type="checkbox"
value=""
id="remember-me"
checked
/>
<label class="form-check-label" for="remember-me">
Remember Me
</label>
</div>
</div>
</div>
<div id="submit" class="mx-auto">
<button type="button" type="submit" class="btn btn-primary">
LOGIN
</button>
</div>
</form>
</div>

Bootstrap Horizontal Form - class="form-group" not working

Form horizontal isnt aligning the label and fields horizontally.
I have a page with a form (which has 4 fields)and a submit and a list at the bottom. I used for the form and another for the list.
I want the form to align as in bootstrap horizontal form. My bootstrap.min.css is this version -> Bootstrap v4.5.0.
My code is as below:
<p-messages [(value)]="msgs"></p-messages>
<p-panel >
<p-header>
Header Example
</p-header>
<form [formGroup]="testForm" (ngSubmit)="submitForm(testForm.value)" class="form-horizontal">
<div class="form-group" *ngIf="!this.isTest" style="padding:10px;">
<label class="control-label col-sm-2">Name:</label>
<div class="col-sm-10">
{{this.name}}
</div>
</div>
<div class="form-group" *ngIf="this.isTest" style="padding:10px;">
<label class="control-label col-sm-2">Display For:</label>
<div class="col-sm-10">
<p-listbox formControlName="names" [options]="names" [(ngModel)]="selectedName" [style]="{'width':'300px'}" [listStyle]="{'max-height':'100px'}" [multiple]="true" [checkbox]="true" [filter]="true" optionLabel="name">
<p-header>
Choose
</p-header>
</p-listbox>
</div>
</div>
<div class="form-group" *ngIf="this.isTest">
<p>Selected Names: <span *ngFor="let c of selectedName" style="margin-right: 10px">{{c.name}}</span></p>
</div>
<div class="form-group" >
<label class="control-label col-sm-2">Start Date:</label>
<div class="col-sm-10">
<p-calendar formControlName="startDate" [showIcon]="true"></p-calendar>
<span style="margin-left:35px">{{startDate|date}}</span>
</div>
</div>
<div class="form-group" >
<label class="control-label col-sm-2">End Date:</label>
<div class="col-sm-10">
<p-calendar formControlName="endDate" [showIcon]="true"></p-calendar>
<span style="margin-left:35px">{{endDate|date}}</span>
</div>
</div>
<div class="form-group" >
<label class="control-label col-sm-2">Message:</label>
<div class="col-sm-10">
<textarea rows="5" formControlName="message" class="form-control" pInputTextArea ></textarea>
</div>
<div class="col-sm-3"></div>
</div>
<div>
<label class="control-label col-sm-4">
<button type="submit" class="btn btn-primary" > Submit </button>
</label>
</div>
</form>
</p-panel>
<p-panel >
<sampleList [sampleLi]="sampleLi"></sampleList>
</p-panel>
I am looking for bootstrap horizontal algnment like in this page Text
But the above one rendered in chrome is one below the other like
Name:
ABCTEST
In IE i am getting the sameone below the other label on top input button/date/text area below in vertical positioning.I dont understand what is wrong with my code.
My bootstrap is referenced in my angular.json file "src/assets/css/bootstrap.min.css". Inspect element in chrome is pointing to the bootstrap.min.css file.
Any inputs highly appreciated ?
Try this, it might not have worked for you because you didn't have the bootstrap embed with it.
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<title>Bootstrap Horizontal Form</title>
</head>
<body style="padding: 50px;">
<form>
<div class="form-group row">
<label for="inputEmail3" class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input type="name" class="form-control" id="name" placeholder="Name">
</div>
</div>
<fieldset class="form-group">
<div class="row">
<legend class="col-form-label col-sm-2 pt-0">Choose</legend>
<div class="col-sm-10">
<div class="form-check">
<input class="form-check-input" type="radio" name="gridRadios" id="option1" value="option1">
<label class="form-check-label" for="gridRadios1">
Option 1
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="gridRadios" id="option2" value="option2">
<label class="form-check-label" for="gridRadios2">
Option 2
</label>
</div>
<div class="form-check disabled">
<input class="form-check-input" type="radio" name="gridRadios" id="option3" value="option3">
<label class="form-check-label" for="gridRadios3">
Option 3
</label>
</div>
</div>
</div><br>
</fieldset>
<div class="form-group row">
<div class="col-sm-2">Select Names</div>
<div class="col-sm-10">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="name1">
<label class="form-check-label" for="name1">
Name 1
</label><br>
<input class="form-check-input" type="checkbox" id="name2">
<label class="form-check-label" for="name2">
Name 2
</label><br>
<input class="form-check-input" type="checkbox" id="name3">
<label class="form-check-label" for="name3">
Name 3
</label><br>
</div>
</div>
</div>
<div class="col-md-3 mb-3">
<label for="validationCustom05">Start Date</label>
<input type="date" class="form-control" id="start-date" name="start-date">
</div>
<div class="col-md-3 mb-3">
<label for="validationCustom05">End Date</label>
<input type="date" class="form-control" id="end-date" name="end-date">
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea class="form-control" id="message" rows="3" name="message" placeholder="Message"></textarea>
</div>
<div class="form-group row">
<div class="col-sm-10">
<button style="width: 122.5%;" type="submit" class="btn btn-primary">Sign in</button>
</div>
</div>
</form>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</body>
</html>

Resize text fields contained by Radio Button (form-check) div

I have a div which is "col-xs-8 col-xs-offset 2" that centers a form in the middle of the screen. Within this form I have two text areas and 4 radio buttons with corresponding text inputs for each. My problem is that while the text areas span the width of the container and resize appropriately when the window is resized, the inputs beside the radio button remain the same size until the browser is resized below their original length at which point they resize smaller. I would like these radio button text inputs to span in the same manner that the text areas do.
I hope this is clear enough.
<link rel="stylesheet" href="style.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<body class="container-fluid">
<div class="row">
<ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"</span></li>
<li>Create Quiz</li>
</ol>
<form method ="POST">
<div class="col-xs-8 col-xs-offset-2">
<fieldset class="form-group">
<legend class="text-center">
<label for="quiz_title" >Quiz Title:
</label>
</legend>
<div class="form-group">
<label for="question_text">Question</label>
<textarea class="form-control" id="explanation_text" rows="2"></textarea>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" name="answer" id="option1" value="radio_option1" required="required">
<label for="option1" class="form-check-label"> Answers: <a><span class="glyphicon glyphicon-pencil"></span></a>
<input class="form-control" type="text" id="option1" required="required">
</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" name="answer" id="option2" value="radio_option2" >
<label for="option2" class="form-check-label">
<input class="form-control" type="text" id="option2" required="required">
</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" name="answer" id="option3" value="radio_option3">
<label for="option3" class="form-check-label">
<input class="form-control" type="text" id="option3" required="required">
</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" name="answer" id="option4" value="radio_option4">
<label for="option4" class="form-check-label">
<input class="form-control" type="text" maxlength="5" id="option4" required="required">
</label>
</div>
<div class="form-group">
<label for="explanation_text">Explanation</label>
<textarea class="form-control" id="explanation_text" rows="2" placeholder="Optional..."></textarea>
</div>
</fieldset>
</div>
<div class="row">
<div class="col-xs-12">
<div class="col-xs-6">
<button type="submit" class="btn btn-primary center-block pull-right" name="question_submit"> Save Question </button>
</div>
<div class="col-xs-6">
<button type="submit" class="btn btn-primary center-block pull-left" name="quiz_submit"> Save Quiz </button>
</div>
</div>
</div>
</form>
</div>
</body>
Resizing Process:
Bootstrap has something called "Input Groups" that you might want to try. You can put the radio button next to a text input in an input group and the text input will fill up the remaining space. Look at some examples here: https://getbootstrap.com/components/#input-groups-checkboxes-radios
Here is something I put together using your code. Click on "Run code snippet" and then click "Full page" to see it in full page mode. Then you can resize the window to see how it will scale.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row">
<ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"</span></li>
<li>Create Quiz</li>
</ol>
<form method ="POST">
<div class="col-xs-8 col-xs-offset-2">
<fieldset class="form-group">
<legend class="text-center">
<label for="quiz_title">Quiz Title:</label>
</legend>
<div class="form-group">
<label for="question_text">Question</label>
<textarea class="form-control" id="explanation_text" rows="2"></textarea>
</div>
<label for="option1">Answers: <a><span class="glyphicon glyphicon-pencil"></span></a></label>
<div class="input-group" style="margin-bottom:10px;">
<span class="input-group-addon">
<input type="radio" name="answer" id="option1" value="radio_option1" required="required">
</span>
<input type="text" class="form-control" id="option1" required="required">
</div>
<div class="input-group" style="margin-bottom:10px;">
<span class="input-group-addon">
<input type="radio" name="answer" id="option2" value="radio_option2" required="required">
</span>
<input type="text" class="form-control" id="option2" required="required">
</div>
<div class="input-group" style="margin-bottom:10px;">
<span class="input-group-addon">
<input type="radio" name="answer" id="option3" value="radio_option3" required="required">
</span>
<input type="text" class="form-control" id="option3" required="required">
</div>
<div class="input-group" style="margin-bottom:10px;">
<span class="input-group-addon">
<input type="radio" name="answer" id="option4" value="radio_option4" required="required">
</span>
<input type="text" class="form-control" id="option4" required="required">
</div>
<div class="form-group">
<label for="explanation_text">Explanation</label>
<textarea class="form-control" id="explanation_text" rows="2" placeholder="Optional..."></textarea>
</div>
</fieldset>
</div>
<div class="row">
<div class="col-xs-12">
<div class="col-xs-6">
<button type="submit" class="btn btn-primary center-block pull-right" name="question_submit"> Save Question </button>
</div>
<div class="col-xs-6">
<button type="submit" class="btn btn-primary center-block pull-left" name="quiz_submit"> Save Quiz </button>
</div>
</div>
</div>
</form>
</div>
</div>

Twitter bootstrap btn-group doesn't allow inline text on your right?

I am trying to display 3 divs (a radio button, a button group and a select) inside a form on the same line and in that order, but I still keep failing.
I have tried this solution but didn't helped me. I really don't know if this is a common problem or I am missing something.
PICTURE
HTML
<form>
<div class="form-group row">
<div class="col-sm-2">
<label for="f-option1">
<input onClick="doSomething()" type="radio" id="f-option1" name="selector" checked>
My radio button</label>
</div>
<div class="btn-toolbar">
<label for="inputEmail3" class="col-sm-1 control-label">My group button:</label>
<div class="col-sm-2 btn-group" data-toggle="buttons">
<label class="btn btn-default"><input type="radio" name="options" id="option5">10</label>
<label class="btn btn-default"><input type="radio" name="options" id="option6">30</label>
<label class="btn btn-default"><input type="radio" name="options" id="option7">60</label>
<label class="btn btn-default"><input type="radio" name="options" id="option8">90</label>
</div>
</div>
<label for="inputEmail2" class="col-sm-1 col-form-label">My select:</label>
<div class="col-sm-2">
<select class="form-control" id="sel1">
<option>1</option>
<option>2</option>
</select>
</div>
</div>
</form>
Try This.
<div class="form-group row">
<div class="col-sm-2">
<label for="f-option1">
<input onclick="doSomething()" type="radio" id="f-option1" name="selector" checked="">
My radio button</label>
</div>
<div class="btn-toolbar" "="">
<label for="inputEmail3" class="col-sm-1 control-label">My group button:</label>
<div class="col-sm-2 btn-group" data-toggle="buttons">
<label class="btn btn-default"><input type="radio" name="options" id="option5">10</label>
<label class="btn btn-default"><input type="radio" name="options" id="option6">30</label>
<label class="btn btn-default"><input type="radio" name="options" id="option7">60</label>
<label class="btn btn-default"><input type="radio" name="options" id="option8">90</label>
</div>
<label for="inputEmail2" class="col-sm-1 col-form-label">My select:</label>
<div class="col-sm-2">
<select class="form-control" id="sel1">
<option>1</option>
<option>2</option>
</select>
</div>
</div>
</div>
Here is one variant of solution. You need just do inline label and dropdown list. Open full page to see result.
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="container">
<div class="row">
<form>
<div class="col-lg-4">
<label for="f-option1">
<input onClick="doSomething()" type="radio" id="f-option1" name="selector" checked>My radio button
</label>
</div>
<div class="col-lg-4">
<div class="input-group">
<label for="inputEmail3" class="control-label">My group button:</label>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default">
<input type="radio" name="options" id="option5">10</label>
<label class="btn btn-default">
<input type="radio" name="options" id="option6">30</label>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="input-group">
<label for="inputEmail2" class="control-label">My select:</label>
<select class="form-control" id="inputEmail2">
<option>1</option>
<option>2</option>
</select>
</div>
</div>
</form>
</div>
</div>