Using radio buttons for tab control using bootstrap

前端 未结 3 510
予麋鹿
予麋鹿 2020-12-25 13:45

I am trying to control tabs with radio buttons to change a content area for a scheduling screen. This works fine other than the radio buttons do not check.

Anyone g

3条回答
  •  离开以前
    2020-12-25 14:18

    The radio buttons aren't getting checked because of this code:

    e.preventDefault()
    

    To fix this, remove data-toggle="tab" from the radio buttons and then add this jQuery code:

    $('input[name="intervaltype"]').click(function () {
        $(this).tab('show');
    });
    

提交回复
热议问题