We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

How to get the values and calculate of radio buttons

Hi, all
It might be the question regarding the JavaScript, rather than OpenClinica. But as I'm beginner of JQuery, It would be very helpful if anyone could teach me.

In my CRF I made a questionnarie like below. Each questions have several option buttons. Please suppose that each answers correspond to the value indicated in the bracket.

1. Question1   Answer:  Very Often(4), Often(3) Sometimes(2) Rarely(1) None(0)
2. Question2   Answer:  Very Often(4), Often(3) Sometimes(2) Rarely(1) None(0)

I just want to simply add up each questions values of selected radio buttons.  I learned how to get the object of radio-groups from sample CRFs but I don't know how to get the value of the selected items among each radio button groups.
Do I have to make the loop and check if each buttons are selected or not, and if selected, then get the value and exit loop and so on? But I guess there should be simpler and smarter solution.

Best Regards,
Yukiko Ito

Best Answer


  • ykkitoykkito Posts: 8
    Hi Sander,

    Thank you very much your prompt reply. You answer helped me a lot.
    I could manage to do and shorten the source code.

This discussion has been closed.