Aditya
Aditya

Reputation: 431

All Radio Buttons are getting selected in bootstrap

After clicking on a radio button if i click on other radio button the checked value is not getting deselected , where am i going wrong ?

I have added a fiddle here http://jsfiddle.net/Lv8xzkhs/

              <fieldset>
            <legend>Property Info</legend>
                <div class="row">
                    <div class="col-md-3 col-xs-12">
                        <label>I want To:</label>
                        <div class="radio">
                          <label><input class="radio-inline" type="radio" >Sale</label>
                          <label><input class="radio-inline" type="radio" >Rent Out</label>
                        </div>                      
                    </div>                  
                    <div class="col-md-3 col-xs-12">
                        <label for="sel1">Looking For:</label>
                        <select class="form-control" id="sel1">
                            <option>PentHouse</option>
                            <option>Villa</option>
                            <option>Plot</option>
                            <option>Studio</option>
                        </select>   
                    </div>
                    <div class="col-md-3 col-xs-12">
                        <label>Location:</label>
                        <input type="text" class="form-control">
                    </div>
                </div>
            </fieldset>

Upvotes: 0

Views: 1411

Answers (1)

BENARD Patrick
BENARD Patrick

Reputation: 30975

Add name attribute to your radio btn

<label><input class="radio-inline" type="radio" name="yourgroup">Sale</label>
<label><input class="radio-inline" type="radio" name="yourgroup">Rent Out</label>

Fiddle: http://jsfiddle.net/Lv8xzkhs/1/

More info : http://www.w3.org/TR/html-markup/input.radio.html

Upvotes: 3

Related Questions