knockout js radio button click event reset selection

后端 未结 3 691
陌清茗
陌清茗 2021-02-13 02:29

I have bind \"checked\" and \"click\" event on a radio button list. But whenever a radio button is clicked, the selection does not stay. I must be doing something really wrong.

3条回答
  •  无人共我
    2021-02-13 03:21

    Basically, your click handler won't end up catching that you want to retain the value.

    What is happening is that it is going back to default after you select an item.

    Simply try:

    return true;

    As the only code in your handler.

    Fiddle away: http://jsfiddle.net/SinisterSystems/jhHkD/4/

提交回复
热议问题