bootstrap: multiple button group on a form

Hello,
  I would like to have multiple button group on a form. However. It seems that I can only select one button.

I would like to select 1 button from each category..

here is the plunk of my code...


http://plnkr.co/edit/2nQyDKXXhTDtGUHaB0M2?p=preview

 <div class= "container">
      <div class="row" style ="padding-top:3.5em">
		<div class="col-xs-12 col-md-12">
			<div class="row"> 
				<label>Distance</label>
			</div>
			<div class="row">
				<div class=" btn-group filterbtnGroup" role="group" aria-label="g1">
					<button type="button" class="btn btn-default filterbtn" >Exact</button>
			  		<button type="button" class="btn btn-default filterbtn">5 Mi</button>
			  		<button type="button" class="btn btn-default filterbtn">10 Mi</button>
			  		<button type="button" class="btn btn-default filterbtn">15 Mi</button>
			  		<button type="button" class="btn btn-default filterbtn">25 Mi</button>
			  		<button type="button" class="btn btn-default filterbtn">50 Mi</button>
				</div>
			</div>
		</div>
	</div>

	<div class="row">
		<div class="col-xs-12 col-md-12">
			<div class="row"> 
				<label>Date Posted</label>
			</div>
			<div class="row">
				<div class="btn-group filterbtnGroup" role="group" aria-label="g1">
					<button type="button" class="btn btn-default filterbtn" >All</button>
			  		<button type="button" class="btn btn-default filterbtn">24 hrs</button>
			  		<button type="button" class="btn btn-default filterbtn">1 week</button>
			  		<button type="button" class="btn btn-default filterbtn">2 weeks</button>
			  		<button type="button" class="btn btn-default filterbtn">3 weeks</button>
			  		
				</div>
			</div>
		</div>
	</div>
      
      
    </div>

Open in new window




Thanks for the help..
chand pbAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom BeckCommented:
I see the markup at the link and a reference to script.js but no code and no css.
chand pbAuthor Commented:
Thanks for responding...

This is straight bootstrap css and js ... No custom style

Are you able  to see the plunker code

http://plnkr.co/edit/2nQyDKXXhTDtGUHaB0M2?p=preview

here is the entire code,,, thanks

<!DOCTYPE html>
<html>

  <head>
    <link data-require="bootstrap@3.3.2" data-semver="3.3.2" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
    <script data-require="bootstrap@3.3.2" data-semver="3.3.2" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
    <script data-require="jquery@2.1.3" data-semver="2.1.3" src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="script.js"></script>
  </head>

  <body>
    <div class= "container">
      <div class="row" style ="padding-top:3.5em">
		<div class="col-xs-12 col-md-12">
			<div class="row"> 
				<label>Distance</label>
			</div>
			<div class="row">
				<div class=" btn-group filterbtnGroup" role="group" aria-label="g1">
					<button type="button" class="btn btn-default filterbtn" >Exact</button>
			  		<button type="button" class="btn btn-default filterbtn">5 Mi</button>
			  		<button type="button" class="btn btn-default filterbtn">10 Mi</button>
			  		<button type="button" class="btn btn-default filterbtn">15 Mi</button>
			  		<button type="button" class="btn btn-default filterbtn">25 Mi</button>
			  		<button type="button" class="btn btn-default filterbtn">50 Mi</button>
				</div>
			</div>
		</div>
	</div>

	<div class="row">
		<div class="col-xs-12 col-md-12">
			<div class="row"> 
				<label>Date Posted</label>
			</div>
			<div class="row">
				<div class="btn-group filterbtnGroup" role="group" aria-label="g2">
					<button type="button" class="btn btn-default filterbtn" >All</button>
			  		<button type="button" class="btn btn-default filterbtn">24 hrs</button>
			  		<button type="button" class="btn btn-default filterbtn">1 week</button>
			  		<button type="button" class="btn btn-default filterbtn">2 weeks</button>
			  		<button type="button" class="btn btn-default filterbtn">3 weeks</button>
			  		
				</div>
			</div>
		</div>
	</div>
      
      
    </div>
  </body>

</html>

Open in new window

Duy PhamFreelance IT ConsultantCommented:
You needs to handle that on your own, either by override $('.btn-group').click(), or like the solution in this: http://jsfiddle.net/nQFxU/3/
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I think Duy Pham has your answer.
chand pbAuthor Commented:
Thanks..
Is there another method of doing it without the button group.. can it be down with ul.li tag..

sorry for follow-up question..
Duy PhamFreelance IT ConsultantCommented:
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
What would help is if you can visualize what you are trying to do.  Perhaps use powerpoint, google docs presentation, omnigraffle, photoshop or whatever you feel comfortable with to draw out what you want. Or can you point to a working sample someplace else?
chand pbAuthor Commented:
Thank you so much for the help

I am building a search form . The user select a button and  the form below should popup. The user can then select a value from each category and submit

test.PNG
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Do you see how in the bootstrap sample they are using inputs styled as buttons.  In this case checkbox's or radio buttons.  The checkbox is to select multiple options for the same item as in, "click all the colors you like".  The radio is to select only one from a group as in, "please choose one distance".  Your sample looks like it should be a radio button.

http://getbootstrap.com/javascript/#buttons  The sample code from bootstrap is below.  You will still need javascript to make it work.  The key is you can see these are radio inputs and the label takes the form of a button by the class "btn" and the color blue comes from the class "btn-primary".  The active state comes from the class "active".  
<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-primary active">
    <input type="radio" name="options" id="option1" autocomplete="off" checked> Radio 1 (preselected)
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options" id="option2" autocomplete="off"> Radio 2
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options" id="option3" autocomplete="off"> Radio 3
  </label>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.