How to make different calculations based on the same radio button values?
<p>I'm a novice. I've made a code based on this post:
<a href="http://stackoverflow.com/questions/14190960/sum-radio-button-values-and-checkboxes-values-in-one-calculation-javascript-an">SUM radio button values and checkboxes values in one calculation - javascript and html</a></p>

<p>I've made two groups of radio buttons with the values 1-5 (first group), and 100-500 (second group).
I need the value of the selected button from each groups to make different calculations with them and display the results.</p>

<p>Here I've multiplied the value of the first group with 2 and added the value of the second group. Now I want to display the result of an other calculation. For example:   </p>

<pre><code>var sum=parseInt(val1-3) + parseInt(val2*4)          
</code></pre>

<p>How can I display both the results at the same time in separate "cells".</p>

<pre><code>&lt;form name="form1" id="form1" runat="server"&gt;
&lt;legend&gt;Header 1&lt;/legend&gt;
&lt;p&gt;&lt;input id="rdo_1" type="radio" value="1" name="price" onClick="DisplayPrice(this.value);"&gt;&lt;label for="radio1"&gt;Radio 1&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="rdo_2" type="radio" value="2" name="price" onClick="DisplayPrice(this.value);"&gt;&lt;label for="radio2"&gt;Radio 2&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="rdo_3" type="radio" value="3" name="price" onClick="DisplayPrice(this.value);"&gt;&lt;label for="radio3"&gt;Radio 3&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="rdo_4" type="radio" value="4" name="price" onClick="DisplayPrice(this.value);"&gt;&lt;label for="radio4"&gt;Radio 4&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="rdo_5" type="radio" value="5" name="price" onClick="DisplayPrice(this.value);"&gt;&lt;label for="radio5"&gt;Radio 5&lt;/label&gt;&lt;/p&gt;
&lt;/form&gt;                    

&lt;hr&gt;

&lt;form name="form2" id="form2" runat="server"&gt;
&lt;legend&gt;Header 2&lt;/legend&gt;
&lt;p&gt;&lt;input id="rdo_1" type="radio" value="100" name="price2" onClick="DisplayPrice(this.value);"&gt;&lt;label for="rad1"&gt;Radio 1&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="rdo_2" type="radio" value="200" name="price2" onClick="DisplayPrice(this.value);"&gt;&lt;label for="rad2"&gt;Radio 2&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="rdo_3" type="radio" value="300" name="price2" onClick="DisplayPrice(this.value);"&gt;&lt;label for="rad3"&gt;Radio 3&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="rdo_4" type="radio" value="400" name="price2" onClick="DisplayPrice(this.value);"&gt;&lt;label for="rad4"&gt;Radio 4&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;input id="rdo_5" type="radio" value="500" name="price2" onClick="DisplayPrice(this.value);"&gt;&lt;label for="rad5"&gt;Radio 5&lt;/label&gt;&lt;/p&gt;
&lt;/form&gt;                             


&lt;p&gt;&lt;label for="valueTotal"&gt;Value$:&lt;/label&gt;
&lt;input type="text" name="valueTotal" id="valueTotal" value="" size="2"readonly="readonly"&gt;    &lt;/p&gt;

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

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

    var sum=parseInt(val1*2) + parseInt(val2);
    document.getElementById('valueTotal').value=sum;
}
&lt;/script&gt;
</code></pre>
