Getting the sum of all radio button values to display in a table

后端 未结 3 2046
Happy的楠姐
Happy的楠姐 2021-01-29 13:14

I have some radio buttons in a table and I’ve set a value to them. When the user selects them and clicks the submit button, I want the sum of those values to show in another tab

3条回答
  •  天涯浪人
    2021-01-29 14:12

    First you need to get the value of the checked radio buttons

    The trick is to get it like this:

    $("input[name='a1_1']:checked").val();
    

    Code example

    Afterwards you can do whatever you want with the values.

    I hope this helps you.

提交回复
热议问题