How can I display a text value for radio buttons using javascript
<p>I am building an online store where the customer can select custom parts.
I'm quite new to javascript, but I've managed to create a radio button list, where the price is added from each section.</p>

<p>I would like a box to show all of the options selected, not just the sum total.</p>

<p>I've included the text with value and used parseInt. Is there an equivalent I can use to pull the text, not the number, from the value?</p>

<p>My code so far:</p>

<pre><code>&lt;head&gt;
    &lt;script type="text/javascript"&gt;
        function DisplayPrice(price){
                        var val1 = 0;
                        for( i = 0; i &lt; document.form1.part.length; i++ ){
                                if( document.form1.part[i].checked == true ){
                                        val1 = document.form1.part[i].value;
                                }
                        }

                        var val2 = 0;
                        for( i = 0; i &lt; document.form2.part2.length; i++ ){
                                if( document.form2.part2[i].checked == true ){
                                        val2 = document.form2.part2[i].value;
                                }
                        }

        var val3 = 0;
                        for( i = 0; i &lt; document.form3.part3.length; i++ ){
                                if( document.form3.part3[i].checked == true ){
                                        val3 = document.form3.part3[i].value;
                                }
                        }


                        var sum=parseInt(val1) + parseInt(val2) + parseInt(val3);
            document.getElementById('totalSum').value=sum;
        }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form name="form1" id="form1" runat="server"&gt;
       &lt;br&gt;
       &lt;input id="rdo_1" type="radio" value="0 1.8ghz2xAMD" name="part" checked="checked" onclick="DisplayPrice(this.value);"&gt;1.8Ghz Dual Core AMD
        &lt;br&gt;
        &lt;input id="rdo_2" type="radio" value="50 2ghz2xAMD" name="part" onclick="DisplayPrice(this.value);"&gt;2Ghz Dual Core AMD
        &lt;br&gt;
    &lt;/form&gt;Choose your memory:&lt;br /&gt;
    &lt;form name="form2" id="form2" runat="server"&gt;
        &lt;br&gt;
        &lt;input id="rdo_1" type="radio" value="0 1333corsair1gb" name="part2" checked="checked" onclick="DisplayPrice(this.value);"&gt;1333 Corsair 1GB
        &lt;br&gt;
        &lt;input id="rdo_2" type="radio" value="50 1333corsair2x1gb" name="part2" onclick="DisplayPrice(this.value);"&gt;1333 Corsair 2x1GB
        &lt;br&gt;
    &lt;/form&gt;Choose your graphics card:&lt;br /&gt;
    &lt;form name="form3" id="form3" runat="server"&gt;
        &lt;br /&gt;
        &lt;input id="rdo_1" type="radio" value="0 5830ATI1gb" name="part3" checked="checked" onclick="DisplayPrice(this.value);"&gt;1GB ATI 5830
        &lt;br /&gt;
        &lt;input id="rdo_2" type="radio" value="50 5850ATI1gb" name="part3" onclick="DisplayPrice(this.value);"&gt;1GB ATI 5850
        &lt;br /&gt;
        &lt;input id="rdo_3" type="radio" value="75 5870ATI1gb" name="part3" onclick="DisplayPrice(this.value);"&gt;1GB ATI 5870
        &lt;br /&gt;
    &lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p>Thanks in advance for any advice you can give.</p>
