html - Bootstrap radio buttons -


i have 3 different sets of radio buttons on same page. problem experiencing them when button in btn-group pressed toggle state of buttons in previous or next btn-group. don't seem independent. here's code:

 <div id="file1" class="btn-group" data-toggle="buttons-radio" >     <button class="btn btn-primary" type="radio" name="radiogroup2" value="yes">yes</button>     <button class="btn btn-danger" type="radio"  name="radiogroup2"onclick="$('#mandatory1').val('no');">no</button> </div>   <div id="file2" class="btn-group" data-toggle="buttons-radio" >     <button class="btn btn-primary" type="radio" name="radiogroup" value="yes">yes</button>     <button class="btn btn-danger" type="radio"  name="radiogroup" onclick="$('#mandatory2').val('no');">no</button> </div> 

when button within div file1 clicked toggles state of button in div id file2

i've tried using button.js this, no luck. i've tried various different variations of data-toggle="button"

any ideas?

this should fix problem:

<div id="file1" class="btn-group" data-toggle="buttons">     <label class="btn btn-primary active"><input type="radio" name="radiogroup2" value="yes">yes</label>     <label class="btn btn-danger"><input type="radio" name="radiogroup2" onclick="$('#mandatory1').val('no');">no</label> </div>   <div id="file2" class="btn-group" data-toggle="buttons">     <label class="btn btn-primary"><input type="radio" name="radiogroup" value="yes">yes</label>     <label class="btn btn-danger active"><input type="radio" name="radiogroup" onclick="$('#mandatory2').val('no');">no</label> </div> 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -