# html5 - 3 radio buttons groups and counting

**URL:** <https://forum.kirupa.com/t/html5-3-radio-buttons-groups-and-counting/633621>\
**Category:** programming\
**Created:** [August 17, 2015, 12:32pm UTC](https://forum.kirupa.com/t/html5-3-radio-buttons-groups-and-counting/633621 "2015-08-17T12:32:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![waycom](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@waycom](https://forum.kirupa.com/u/waycom)\
**Post date:** [August 17, 2015, 12:32pm UTC](https://forum.kirupa.com/t/html5-3-radio-buttons-groups-and-counting/633621/1 "2015-08-17T12:32:13Z")

</div>

hi,  
i have a problem with an html file - with 3 radio buttons groups

I need it for clothing sizes - the customer push the radio Button for  
Body height - Body weight and Male/Female - if I push the Button  
the Customer get the size (S/M/L/XL/XXL) i have no idea what must be done  
for making the first steps - but i am hanging in the air now how each information together shows a result !!  
this ist the script  
this is the link [http://jsfiddle.net/waycom/71L5vjv5/1/](http://jsfiddle.net/waycom/71L5vjv5/1/)

---

<div class="post-metadata">

**Author:** ![zeke\_chan](https://avatars.discourse-cdn.com/v4/letter/z/f14d63/32.png) [@zeke\_chan](https://forum.kirupa.com/u/zeke_chan)\
**Post date:** [August 20, 2015, 3:36am UTC](https://forum.kirupa.com/t/html5-3-radio-buttons-groups-and-counting/633621/2 "2015-08-20T03:36:17Z")

</div>

For some reason, your radioWert function is not defined when you click on the “Your Size” button. It could be an issue with JSFiddle. However, there needs to also be some changes to your existing code:

HTML form:

```
<input type="button" value="Your Size" onClick="alert(radioWert('myForm', 'radio'))">

```

Javascript:

```
 function radioWert(form, rObj) {
     var radioGroup = form.elements[rObj];

     for (var i = 0; i < radioGroup.length; i++) {
         if (radioGroup[i].checked) {
             return radioGroup[i].value;
         }
     }
     
     return false;
 }

```

Hope that helps
