make checkbox behave like radio buttons with javascript

前端 未结 11 753
迷失自我
迷失自我 2020-11-28 06:28

I need to manipulate the behavior of the check boxes with javascript. They should basically behave like radio buttons (only one selectable at a time, plus unselect any previ

11条回答
  •  孤独总比滥情好
    2020-11-28 07:18

    Just in case it helps someone else

    I was having the same situation where my client needed to have a checkbox behaving like a radio button. But to me it was meaningless to use a checkbox and make it act like radio button and it was very complex for me as I was using so many checkboxes in a GridView Control.

    My Solution:
    So, I styled a radio button look like a checkbox and took the help of grouping of radio buttons.

提交回复
热议问题