javascript - Call another modal when radio checked -


i have 2 modal window, written in bootstrap. when click in first modal on radio, want close modal , open another.

my html first form:

<div class="modal fade" id="overlay" role="dialog"> <div class="modal-dialog">     <div class="modal-content">         <div class="modal-header">             <button type="button" class="close" data-dismiss="modal">&times;</button>             <h4 class="modal-title">can help?</h4>         </div>         <div class="modal-body">             <label for="callback">callback</label>             <input type="radio" id="callbackradio">             <label for="contactus">contact us</label>             <input type="radio" id="contactusradio">         </div>         <div class="modal-footer">             <button type="button" class="btn btn-default" data-dismiss="modal">close</button>         </div>     </div> </div> </div> 

my js code:

if($('#contactusradio').is('checked')){       $('#overlay').modal('hide');       $('#contactusmodal').modal('show'); } 

but doesn't work.

need trigger event (assuming aren't, haven't pasted in code)

$('#contactusradio').on('click', function() {     if($('#contactusradio').is(':checked')) {         $('#overlay').modal('hide');         $('#contactusmodal').modal('show');     } }); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -